@mkbabb/glass-ui 10.1.3 → 11.0.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.
Files changed (219) hide show
  1. package/MIGRATION.md +1024 -1461
  2. package/README.md +2 -2
  3. package/dist/DialogContent-DG5kseRQ.js +159 -0
  4. package/dist/DropdownMenuTrigger-uhSXgEfK.js +76 -0
  5. package/dist/{Surface-1nPoabc3.js → Surface-C7wq2j0A.js} +3 -0
  6. package/dist/aurora.css +1 -0
  7. package/dist/aurora.js +246 -2472
  8. package/dist/auroraImageSource-xNLDUjcy.js +30 -0
  9. package/dist/axes.js +8 -8
  10. package/dist/blob.css +1 -0
  11. package/dist/blob.js +57 -54
  12. package/dist/budget-CJfhLIIV.js +13 -0
  13. package/dist/button-CAKhiOZy.js +113 -0
  14. package/dist/button.js +1 -1
  15. package/dist/{card-ByyqRBvK.js → card-D_uXphvL.js} +4 -1
  16. package/dist/card.js +1 -1
  17. package/dist/carousel.js +3 -2
  18. package/dist/{checkbox-B1qn65se.js → checkbox-COLnvULu.js} +1 -0
  19. package/dist/checkbox.css +1 -0
  20. package/dist/checkbox.js +1 -1
  21. package/dist/{collapsible-DFzK29Oh.js → collapsible-Bd4Et730.js} +1 -0
  22. package/dist/collapsible.css +1 -0
  23. package/dist/collapsible.js +1 -1
  24. package/dist/color-HkUaTAJj.js +270 -0
  25. package/dist/{color.glsl-DTJhdekG.js → color.glsl-bFJm8k5R.js} +4 -16
  26. package/dist/color.wgsl-B-qDJ_OM.js +4 -0
  27. package/dist/{command-CatrAsrl.js → command-BsFOGZwB.js} +3 -2
  28. package/dist/command.css +1 -0
  29. package/dist/command.js +1 -1
  30. package/dist/component-styles.css +0 -1
  31. package/dist/components/_shared/axes.d.ts +7 -0
  32. package/dist/components/_shared/feedback/dot-ring.css +1 -1
  33. package/dist/components/_shared/overlay/focus-return.d.ts +9 -0
  34. package/dist/components/_shared/overlay/index.d.ts +3 -0
  35. package/dist/components/_shared/overlay/root-scroll-lock.d.ts +4 -0
  36. package/dist/components/_shared/overlay/sheet-width.d.ts +2 -0
  37. package/dist/components/_shared/shape/useBarShape.d.ts +4 -0
  38. package/dist/components/aurora/composables/auroraFallbackGround.d.ts +12 -0
  39. package/dist/components/aurora/constants/presets.d.ts +21 -0
  40. package/dist/components/aurora/index.d.ts +2 -2
  41. package/dist/components/button/styles.css +1 -1
  42. package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -1
  43. package/dist/components/data-table/composables/useDataTableResponsive.d.ts +2 -0
  44. package/dist/components/deck/styles/capture.css +1 -1
  45. package/dist/components/dialog/DialogContent.vue.d.ts +2 -2
  46. package/dist/components/dialog/ModalOverlay.vue.d.ts +2 -2
  47. package/dist/components/dialog/ModalScrim.vue.d.ts +26 -0
  48. package/dist/components/dialog/styles.css +1 -1
  49. package/dist/components/dock/GlassDock.vue.d.ts +4 -1
  50. package/dist/components/dock/composables/useDockClickIntegrity.d.ts +4 -0
  51. package/dist/components/dock/composables/useDockShellProps.d.ts +34 -2
  52. package/dist/components/dock/composables/useDockState.d.ts +5 -0
  53. package/dist/components/dock/index.d.ts +1 -2
  54. package/dist/components/dock/styles/controls/icon-button.css +1 -1
  55. package/dist/components/dock/styles/controls/tab-button.css +1 -1
  56. package/dist/components/dock/styles/morph.css +1 -1
  57. package/dist/components/dock/styles/run.css +1 -1
  58. package/dist/components/dock/trigger.d.ts +1 -0
  59. package/dist/components/expandable-container/ExpandableContainer.vue.d.ts +30 -29
  60. package/dist/components/menu/ContextMenu.vue.d.ts +27 -0
  61. package/dist/components/menu/DropdownMenu.vue.d.ts +5 -23
  62. package/dist/components/menu/context.d.ts +18 -5
  63. package/dist/components/menu/family-click.d.ts +2 -0
  64. package/dist/components/menu/family-context.d.ts +2 -0
  65. package/dist/components/menu/index.d.ts +1 -1
  66. package/dist/components/sheet/SheetContent.vue.d.ts +2 -2
  67. package/dist/components/sortable-list/styles.css +1 -0
  68. package/dist/components/surface/Surface.vue.d.ts +4 -1
  69. package/dist/components/tabs/composables/useTabDragMorph.d.ts +4 -7
  70. package/dist/components/tabs/styles/segmented.css +1 -1
  71. package/dist/components/tabs/types.d.ts +7 -8
  72. package/dist/composables/dom/useResizeObserver.d.ts +3 -1
  73. package/dist/composables/glass/fieldPaint.d.ts +4 -0
  74. package/dist/composables/glass/useGlassBackdropLuminance.d.ts +7 -6
  75. package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +8 -0
  76. package/dist/composables/motion/core/motionTempo.d.ts +2 -1
  77. package/dist/composables/motion/morph/useDragMorph.d.ts +2 -2
  78. package/dist/composables/motion/morph/useSelectionGroup.d.ts +6 -25
  79. package/dist/composables/motion/morph/useSelectionIndicator.d.ts +8 -54
  80. package/dist/composables/motion/spring/useLiquidFlex.d.ts +3 -5
  81. package/dist/composables/motion/spring/useSpringMount.d.ts +0 -9
  82. package/dist/{configurator-CPxIo3q2.js → configurator-C1ZKEf1b.js} +7 -5
  83. package/dist/configurator.css +1 -0
  84. package/dist/configurator.js +1 -1
  85. package/dist/constants-DfrO-IaH.js +8 -0
  86. package/dist/constellation.css +1 -0
  87. package/dist/constellation.js +2 -1
  88. package/dist/control.css +1 -0
  89. package/dist/{control.css_vue_type_style_index_0_src_true_lang-BIdufaDG.js → control.css_vue_type_style_index_0_src_true_lang-D2hdtjs4.js} +1 -0
  90. package/dist/{createCanvasLifecycle-hJHobVTn.js → createCanvasLifecycle-DS0vEs_G.js} +76 -75
  91. package/dist/dark-mode-toggle.js +1 -1
  92. package/dist/{data-table-Cs93-uY7.js → data-table-lDykVYuo.js} +113 -107
  93. package/dist/data-table.css +1 -0
  94. package/dist/data-table.js +1 -1
  95. package/dist/{deck-Cm_VmyNL.js → deck-Bc-2mEKE.js} +1 -0
  96. package/dist/deck.js +1 -1
  97. package/dist/dialog.js +1 -1
  98. package/dist/dock-trigger.d.ts +1 -0
  99. package/dist/dock-trigger.js +88 -0
  100. package/dist/dock.js +677 -689
  101. package/dist/dom.js +1 -1
  102. package/dist/easing.js +4 -4
  103. package/dist/expandable-container-wS1awXGd.js +135 -0
  104. package/dist/expandable-container.css +1 -0
  105. package/dist/expandable-container.js +1 -1
  106. package/dist/{fading-scroll-CTeW3KNS.js → fading-scroll-D3Y20ibL.js} +2 -2
  107. package/dist/fading-scroll.js +1 -1
  108. package/dist/fieldPaint-Ci77oajZ.js +7 -0
  109. package/dist/fourier-field.css +1 -0
  110. package/dist/fourier-field.js +15 -13
  111. package/dist/glSetup-DMaDgrEj.js +577 -0
  112. package/dist/glass-ui.js +67 -66
  113. package/dist/handmark.css +1 -0
  114. package/dist/handmark.js +82 -71
  115. package/dist/index.css +1 -0
  116. package/dist/index.d.ts +1 -1
  117. package/dist/{input-eLZ_AU7l.js → input-BLF2pMHE.js} +1 -1
  118. package/dist/input.js +1 -1
  119. package/dist/{label-CE03H1KL.js → label-ryNPL7e6.js} +1 -0
  120. package/dist/label.css +1 -0
  121. package/dist/label.js +1 -1
  122. package/dist/labeled-field.css +1 -0
  123. package/dist/labeled-field.js +5 -4
  124. package/dist/{menu-DaYAZiVW.js → menu-C_l2Sslf.js} +162 -112
  125. package/dist/menu.js +3 -3
  126. package/dist/metric.js +1 -0
  127. package/dist/motion-core.js +138 -44
  128. package/dist/motion-lHDAQHEE.js +91 -0
  129. package/dist/motion.js +5 -5
  130. package/dist/motionTempo-DXdVbCWr.js +13 -0
  131. package/dist/music-staff.js +1 -0
  132. package/dist/{number-field-RP89046a.js → number-field-BXFUP49Z.js} +3 -2
  133. package/dist/number-field.css +1 -0
  134. package/dist/number-field.js +1 -1
  135. package/dist/pager-dots.css +1 -0
  136. package/dist/pager-dots.js +4 -3
  137. package/dist/participation-C5y5VZTN.js +52 -0
  138. package/dist/{popover-BdpoE4Ar.js → popover-DQUmwuAa.js} +3 -2
  139. package/dist/popover.js +1 -1
  140. package/dist/{progress-eVa-mc7J.js → progress-BUn0Bw7Z.js} +1 -0
  141. package/dist/progress.css +1 -0
  142. package/dist/progress.js +1 -1
  143. package/dist/{radio-group-B58Bz16F.js → radio-group-xdEy2tdi.js} +1 -0
  144. package/dist/radio-group.css +1 -0
  145. package/dist/radio-group.js +1 -1
  146. package/dist/root-scroll-lock-DJFrQhMa.js +22 -0
  147. package/dist/select-Dt5dXm87.js +309 -0
  148. package/dist/select.js +1 -1
  149. package/dist/{separator-D4EZM10u.js → separator-C4y9p_ky.js} +1 -0
  150. package/dist/separator.css +1 -0
  151. package/dist/separator.js +1 -1
  152. package/dist/sheet-DLqNUIZl.js +347 -0
  153. package/dist/sheet-width-DgXgJNa5.js +18 -0
  154. package/dist/sheet.js +2 -2
  155. package/dist/{slider-5uoY-cLG.js → slider-CZiKrWGg.js} +8 -8
  156. package/dist/slider.js +1 -1
  157. package/dist/sortable-list.js +2 -1
  158. package/dist/{status-dot-W4LFiJps.js → status-dot-BDZKcRxy.js} +2 -1
  159. package/dist/status-dot.css +1 -0
  160. package/dist/status-dot.js +1 -1
  161. package/dist/styles/components.css +1 -1
  162. package/dist/styles/glass/glass-capsule.css +1 -1
  163. package/dist/styles/glass/glass-chip.css +1 -1
  164. package/dist/styles/glass/mark.css +1 -1
  165. package/dist/styles/glass/overlay-plate.css +1 -1
  166. package/dist/styles/glass/surface-axis.css +1 -1
  167. package/dist/styles/index.css +1 -1
  168. package/dist/styles/theme/radius.css +1 -1
  169. package/dist/styles/tokens/color-radius.css +1 -1
  170. package/dist/styles/tokens/manifest.d.ts +1 -1
  171. package/dist/styles/tokens/scale-paper.css +1 -1
  172. package/dist/styles/utilities/base-misc.css +1 -1
  173. package/dist/surface.js +1 -1
  174. package/dist/{switch-BYUZ6g9G.js → switch-DLfGYU35.js} +1 -0
  175. package/dist/switch.css +1 -0
  176. package/dist/switch.js +1 -1
  177. package/dist/tabs-NgTRPGZx.js +229 -0
  178. package/dist/tabs.js +1 -1
  179. package/dist/textarea.js +1 -1
  180. package/dist/timeline.css +1 -0
  181. package/dist/timeline.js +4 -3
  182. package/dist/toggle-group-DgXcJGD6.js +129 -0
  183. package/dist/toggle-group.css +1 -0
  184. package/dist/toggle-group.js +1 -1
  185. package/dist/tokens.js +2 -0
  186. package/dist/{tooltip-CZVubnJf.js → tooltip-Do3qCw0r.js} +1 -1
  187. package/dist/tooltip.js +1 -1
  188. package/dist/typewriter.css +1 -0
  189. package/dist/typewriter.js +1 -0
  190. package/dist/uniformBridge-CJyy7NOn.js +150 -0
  191. package/dist/useBarShape-CmP35Z8o.js +24 -0
  192. package/dist/{useCanvas2D-CQRElMyE.js → useCanvas2D-Bhpwua98.js} +1 -1
  193. package/dist/{useDockCtaReceive-BSSgD6mu.js → useDockCtaReceive-Dn_-paqP.js} +1 -1
  194. package/dist/{useDragMorph-B363RUbF.js → useDragMorph-BEI74U0t.js} +51 -40
  195. package/dist/{color.wgsl-BTszLY39.js → useGpuSubstrate-Y5XAdU8d.js} +7 -7
  196. package/dist/{useLiquidPress-h1scrPtP.js → useLiquidPress-D5mjZC6U.js} +2 -2
  197. package/dist/{useResizeObserver-CdUlm2QZ.js → useResizeObserver-Bv3nN46q.js} +4 -7
  198. package/dist/useScrollChrome-DMP6kDI9.js +67 -0
  199. package/dist/useSelectionGroup-DAQv5Lb5.js +186 -0
  200. package/dist/{useSpring-9u2_shxV.js → useSpring-Aof0nTRt.js} +1 -1
  201. package/dist/useSpringMount-jgNkymRl.js +73 -0
  202. package/dist/wgpuSetup-CFuqd_RP.js +1278 -0
  203. package/package.json +8 -1
  204. package/dist/DialogContent-CwIBvou_.js +0 -157
  205. package/dist/DropdownMenuTrigger-CKRnhDSQ.js +0 -93
  206. package/dist/button-BOFTUPyU.js +0 -110
  207. package/dist/composables/motion/morph/eyeglass.d.ts +0 -141
  208. package/dist/expandable-container-CZUj9BzY.js +0 -142
  209. package/dist/glass-ui.css +0 -2
  210. package/dist/motion-BvV1_24p.js +0 -61
  211. package/dist/motionTempo-tscp92Nm.js +0 -7
  212. package/dist/participation-B7UFdgXB.js +0 -55
  213. package/dist/select-BiF0FCZf.js +0 -292
  214. package/dist/sheet-DmJxgAHc.js +0 -345
  215. package/dist/tabs-C5sC0fBE.js +0 -269
  216. package/dist/toggle-group-CC5b3o1R.js +0 -125
  217. package/dist/useScrollChrome-BJbWV32F.js +0 -162
  218. package/dist/useSelectionGroup-zsEwitF6.js +0 -291
  219. package/dist/useSpringMount-OA-0mTNv.js +0 -73
@@ -1,125 +0,0 @@
1
- import { t as e } from "./class-names-FlXcvRRT.js";
2
- import { t } from "./control-DJp15L4U.js";
3
- import { t as n } from "./createContext-BhkE9mLH.js";
4
- import { t as r } from "./useSelectionGroup-zsEwitF6.js";
5
- import { computed as i, createElementBlock as a, defineComponent as o, mergeModels as s, mergeProps as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, shallowRef as m, triggerRef as h, unref as g, useModel as _ } from "vue";
6
- //#region src/components/toggle-group/context.ts
7
- var v = n("glass-ui:toggle-group");
8
- function y(e) {
9
- v.provide(e);
10
- }
11
- var b = v.use, x = [
12
- "role",
13
- "data-type",
14
- "data-size",
15
- "data-orientation"
16
- ], S = /* @__PURE__ */ o({
17
- name: "ToggleGroup",
18
- __name: "ToggleGroup",
19
- props: /*@__PURE__*/ s({
20
- type: {},
21
- orientation: { default: "horizontal" },
22
- size: { default: "md" },
23
- class: { type: [
24
- Boolean,
25
- null,
26
- String,
27
- Object,
28
- Array
29
- ] },
30
- invalid: { type: Boolean },
31
- disabled: { type: Boolean }
32
- }, {
33
- modelValue: {},
34
- modelModifiers: {}
35
- }),
36
- emits: ["update:modelValue"],
37
- setup(n) {
38
- let o = n, s = _(n, "modelValue"), l = f(null), u = m([]);
39
- function v(e) {
40
- return [...e].sort((e, t) => {
41
- if (!e.el || !t.el) return 0;
42
- let n = e.el.compareDocumentPosition(t.el);
43
- return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
44
- });
45
- }
46
- let b = i(() => v(u.value)), S = i(() => b.value.map((e) => ({
47
- value: e.value,
48
- disabled: e.disabled()
49
- }))), C = i(() => b.value.map((e) => e.el).filter((e) => !!e)), w = r({
50
- options: S,
51
- model: s,
52
- mode: i(() => o.type),
53
- vertical: i(() => o.orientation === "vertical"),
54
- activation: i(() => o.type === "single" ? "automatic" : "manual"),
55
- containerRef: l,
56
- buttonRefs: C
57
- });
58
- return y({
59
- register(e) {
60
- u.value.push(e), h(u);
61
- },
62
- unregister(e) {
63
- let t = u.value.indexOf(e);
64
- t >= 0 && u.value.splice(t, 1), h(u);
65
- },
66
- isSelected: (e) => w.isSelected(e),
67
- itemAttrs: (e) => w.itemAttrs(e),
68
- tabindex: (e) => w.rovingTabindex(b.value.indexOf(e)),
69
- select: (e) => w.select(e.value, b.value.indexOf(e)),
70
- disabled: i(() => o.disabled ?? !1)
71
- }), (n, r) => (d(), a("div", c({
72
- ref_key: "containerRef",
73
- ref: l,
74
- "data-slot": "toggle-group",
75
- class: g(e)("toggle-group", o.class),
76
- role: g(w).groupRole.value,
77
- "data-type": o.type,
78
- "data-size": o.size,
79
- "data-orientation": o.orientation
80
- }, g(t)(o.invalid), { onKeydown: r[0] ||= (...e) => g(w).onKeydown && g(w).onKeydown(...e) }), [p(n.$slots, "default")], 16, x));
81
- }
82
- }), C = [
83
- "data-state",
84
- "disabled",
85
- "tabindex"
86
- ], w = /* @__PURE__ */ o({
87
- name: "ToggleGroupItem",
88
- __name: "ToggleGroupItem",
89
- props: {
90
- value: {},
91
- disabled: { type: Boolean },
92
- class: { type: [
93
- Boolean,
94
- null,
95
- String,
96
- Object,
97
- Array
98
- ] }
99
- },
100
- setup(t) {
101
- let n = t, r = f(null), o = b(), s = {
102
- get value() {
103
- return n.value;
104
- },
105
- disabled: () => n.disabled === !0 || (o?.disabled.value ?? !1),
106
- el: null
107
- };
108
- u(() => {
109
- s.el = r.value, o?.register(s);
110
- }), l(() => o?.unregister(s));
111
- let m = i(() => o?.isSelected(n.value) ?? !1), h = i(() => s.disabled());
112
- return (t, i) => (d(), a("button", c({
113
- ref_key: "el",
114
- ref: r,
115
- type: "button",
116
- "data-slot": "toggle-group-item",
117
- class: g(e)("toggle-group__item control-surface glass-control-edge glass-capsule-hover tap-squish focus-ring", n.class),
118
- "data-state": m.value ? "on" : "off",
119
- disabled: h.value || void 0,
120
- tabindex: g(o)?.tabindex(s) ?? 0
121
- }, g(o)?.itemAttrs(n.value), { onClick: i[0] ||= (e) => g(o)?.select(s) }), [p(t.$slots, "indicator", { selected: m.value }), p(t.$slots, "default")], 16, C));
122
- }
123
- });
124
- //#endregion
125
- export { S as n, w as t };
@@ -1,162 +0,0 @@
1
- import { n as e } from "./useReducedMotion-vCXA_vyM.js";
2
- import { t } from "./asElement-CRnm6A2v.js";
3
- import { t as n } from "./useScrollTrigger-Abe5dEeO.js";
4
- import { n as r } from "./useIntersectionPause-CzKR3EyP.js";
5
- import { computed as i, getCurrentScope as a, onBeforeUnmount as o, onScopeDispose as s, readonly as c, ref as l, toValue as u, watch as d } from "vue";
6
- //#region src/composables/motion/core/useYieldToMain.ts
7
- function f() {
8
- let e = globalThis.scheduler;
9
- return typeof e?.yield == "function" ? e.yield.bind(e) : null;
10
- }
11
- function p() {
12
- let e = f();
13
- return e ? e() : typeof MessageChannel == "function" ? new Promise((e) => {
14
- let t = new MessageChannel();
15
- t.port1.onmessage = () => {
16
- t.port1.onmessage = null, e();
17
- }, t.port2.postMessage(void 0);
18
- }) : new Promise((e) => setTimeout(e, 0));
19
- }
20
- function m() {
21
- return {
22
- hasNativeYield: f() !== null,
23
- yield: p
24
- };
25
- }
26
- //#endregion
27
- //#region src/composables/motion/core/useRAFLoop.ts
28
- function h() {
29
- return typeof globalThis.requestAnimationFrame == "function" ? globalThis.requestAnimationFrame.bind(globalThis) : null;
30
- }
31
- function g() {
32
- return typeof globalThis.cancelAnimationFrame == "function" ? globalThis.cancelAnimationFrame.bind(globalThis) : null;
33
- }
34
- function _(t, n = {}) {
35
- let { immediate: o = !0, pauseWhenHidden: u = !0, respectReducedMotion: f = !0 } = n, m = l(!1), _ = f ? e() : l(!1), v = i(() => _.value), y = l(!1), b = l(!1), x = l(!1), S = i(() => b.value && !m.value && (x.value || y.value || v.value || !h())), C = null, w = null, T = 0, E = 0, D = !1, O = null, k = null, A = null;
36
- function j() {
37
- return !D && b.value && !x.value && !y.value && !v.value && !!h();
38
- }
39
- function M() {
40
- C !== null && (g()?.(C), C = null), m.value = !1, w = null;
41
- }
42
- function N() {
43
- if (C !== null || !j()) return;
44
- let e = h();
45
- e && (m.value = !0, C = e((e) => {
46
- if (C = null, !j()) {
47
- M();
48
- return;
49
- }
50
- let n = w === null ? 0 : Math.max(0, e - w);
51
- w = e, T += n, t({
52
- now: e,
53
- delta: n,
54
- elapsed: T,
55
- frame: E++
56
- }), j() ? N() : M();
57
- }));
58
- }
59
- function P() {
60
- j() ? N() : M();
61
- }
62
- function F() {
63
- w = null, T = 0, E = 0;
64
- }
65
- function I() {
66
- D || (F(), b.value = !0, x.value = !1, P());
67
- }
68
- function L() {
69
- b.value = !1, x.value = !1, F(), M();
70
- }
71
- function R() {
72
- b.value && (x.value = !0, P());
73
- }
74
- function z() {
75
- D || (x.value = !1, P());
76
- }
77
- if (u) {
78
- let e = r(), { hidden: t } = e;
79
- A = e.dispose, y.value = t.value, k = d(t, (e) => {
80
- y.value = e, P();
81
- }, { flush: "sync" });
82
- }
83
- O = d(v, P, { flush: "sync" });
84
- function B() {
85
- D || (D = !0, L(), k?.(), k = null, A?.(), A = null, O?.(), O = null);
86
- }
87
- return a() && s(B), o && I(), {
88
- isActive: c(m),
89
- isPaused: c(S),
90
- isReducedMotion: v,
91
- start: I,
92
- stop: L,
93
- pause: R,
94
- resume: z,
95
- dispose: B,
96
- yieldToMain: p
97
- };
98
- }
99
- //#endregion
100
- //#region src/composables/motion/scroll/useScrollChrome.ts
101
- function v(e) {
102
- return e < 0 ? 0 : e > 1 ? 1 : e;
103
- }
104
- function y(r, i = {}) {
105
- let { collapseOnScroll: a = !1, flipDeltaPx: s = 8, velocityGate: c, snapMidpoint: f = .5, collapseRangePx: p = 116, chromeRef: m, respectReducedMotion: h = !0, scrollStopMs: g = 140 } = i, _ = l(0), y = l(!1), b = h ? e() : l(!1), x = null, S = null, C = !1;
106
- function w() {
107
- if (m == null) return null;
108
- let e = u(m), n = t(e);
109
- return n == null && e != null && !C && (C = !0, console.warn("[useScrollChrome] chromeRef resolved to a non-element (a fragment-root component exposes a non-element `$el`); `--chrome-collapse-t` will not paint. Pass an element ref or expose the component's root element.")), n;
110
- }
111
- function T(e) {
112
- let t = b.value ? +(e >= f) : v(e);
113
- _.value = t, y.value = t >= f, w()?.style.setProperty("--chrome-collapse-t", String(t));
114
- }
115
- function E() {
116
- x && clearTimeout(x), x = setTimeout(() => {
117
- x = null;
118
- let e = +(_.value >= f);
119
- S = null, T(e);
120
- }, g);
121
- }
122
- let { direction: D, velocity: O, recalculate: k } = n(r, {
123
- flipDeltaPx: s,
124
- trackProgress: !1,
125
- respectReducedMotion: h,
126
- onCross: () => {}
127
- });
128
- function A(e, t, n) {
129
- if (!a || e == null) return;
130
- if (c != null && Math.abs(n) >= c) {
131
- S = null, T(+(e === "down")), E();
132
- return;
133
- }
134
- S ??= t - _.value * p;
135
- let r = p > 0 ? p : 1;
136
- T((t - S) / r), E();
137
- }
138
- function j() {
139
- let e = u(r);
140
- return e instanceof HTMLElement ? e.scrollTop : typeof window < "u" && (window.scrollY || window.pageYOffset) || 0;
141
- }
142
- d(() => D.value, () => {
143
- S = null;
144
- });
145
- let M = d(b, () => T(_.value), { flush: "sync" });
146
- d(() => O.value, (e) => {
147
- A(D.value, j(), e);
148
- });
149
- function N() {
150
- k(), S = null, T(_.value);
151
- }
152
- return o(() => {
153
- x && clearTimeout(x), x = null, M();
154
- }), {
155
- collapseT: _,
156
- collapsed: y,
157
- direction: D,
158
- recalculate: N
159
- };
160
- }
161
- //#endregion
162
- export { p as i, _ as n, m as r, y as t };
@@ -1,291 +0,0 @@
1
- import { t as e } from "./useLiquidFlex-TJZmRqyY.js";
2
- import { n as t, r as n } from "./writeVelocityWeight-DoGOCW3e.js";
3
- import { computed as r, nextTick as i, onMounted as a, onUnmounted as o, ref as s, watch as c } from "vue";
4
- var l = 1.22, u = 1 / 3;
5
- (l - 1) / 2;
6
- function d(e) {
7
- let { from: t, to: n, track: r } = e, i = e.spanMax ?? 1.6, a = n.end - n.start;
8
- if (!(a > 0)) return {
9
- span: 1,
10
- clamped: !1,
11
- direction: 0
12
- };
13
- let o = Math.min(t.start, n.start), s = (Math.max(t.end, n.end) - o) / a;
14
- if (!(s > 1)) return {
15
- span: 1,
16
- clamped: !1,
17
- direction: 0
18
- };
19
- let c = (n.start + n.end) / 2, l = (t.start + t.end) / 2, d = c > l ? 1 : c < l ? -1 : 0, f = Infinity;
20
- if (r) {
21
- let e = u, t = d >= 0 ? r.end - n.end : n.start - r.start, i = d >= 0 ? n.start - r.start : r.end - n.end, o = 1 + Math.max(0, t) / ((1 - e) * a), s = 1 + Math.max(0, i) / (e * a);
22
- f = Math.min(o, s);
23
- }
24
- let p = Math.min(s, i, f);
25
- return {
26
- span: Math.max(1, p),
27
- clamped: p < s,
28
- direction: d
29
- };
30
- }
31
- function f(e, t = l) {
32
- return 1 + (e < 0 ? 0 : e > 1 ? 1 : e) * (t - 1);
33
- }
34
- function p(e) {
35
- if (e === 0) return 50;
36
- let t = u * 100;
37
- return e > 0 ? 100 - t : t;
38
- }
39
- //#endregion
40
- //#region src/composables/motion/morph/useSelectionIndicator.ts
41
- var m = 1.11, h = .82;
42
- function g(r) {
43
- let { containerRef: l, indicatorRef: u, buttonRefs: g, options: _, model: v, activeValues: y, vertical: b } = r, x = () => r.deform?.value ?? "plate", S = s({
44
- left: "0px",
45
- top: "0px",
46
- width: "0px",
47
- height: "0px",
48
- translate: "0px 0px",
49
- opacity: "0"
50
- });
51
- function C() {
52
- if (!u.value) return;
53
- let e = _.value.findIndex((e) => e.value === v.value), t = l.value;
54
- if (e < 0) {
55
- S.value = {
56
- ...S.value,
57
- opacity: "0"
58
- };
59
- return;
60
- }
61
- if (!t || !g.value[e]) {
62
- S.value = {
63
- ...S.value,
64
- opacity: "0"
65
- };
66
- return;
67
- }
68
- let n = g.value[e], r = t.getBoundingClientRect(), i = n.getBoundingClientRect(), a = i.left - r.left - t.clientLeft + t.scrollLeft, o = i.top - r.top - t.clientTop + t.scrollTop;
69
- S.value = {
70
- left: "0px",
71
- top: "0px",
72
- width: `${i.width}px`,
73
- height: `${i.height}px`,
74
- translate: `${a}px ${o}px`,
75
- opacity: "1"
76
- };
77
- }
78
- function w() {
79
- C();
80
- }
81
- let T = -1, E = null, D = m, O = e({
82
- from: 0,
83
- to: 0,
84
- axis: "width",
85
- squishLaw: "linear",
86
- maxStretch: () => D
87
- });
88
- function k() {
89
- return typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
90
- }
91
- function A(e) {
92
- let t = getComputedStyle(e).getPropertyValue("--tab-indicator-duration").trim();
93
- return t ? t.endsWith("ms") ? Number.parseFloat(t) || 220 : t.endsWith("s") ? (Number.parseFloat(t) || .22) * 1e3 : Number.parseFloat(t) || 220 : 220;
94
- }
95
- function j(e) {
96
- let r = u.value;
97
- if (!r) {
98
- T = e;
99
- return;
100
- }
101
- if (x() === "none") {
102
- T = e;
103
- return;
104
- }
105
- if (k()) {
106
- T = e;
107
- return;
108
- }
109
- let i = g.value[T], a = g.value[e];
110
- if (T = e, !i || !a) return;
111
- let o = l.value?.getBoundingClientRect(), s = i.getBoundingClientRect(), c = a.getBoundingClientRect(), m = b.value ? o?.height || 1 : o?.width || 1, _ = b.value ? Math.abs(c.top + c.height / 2 - (s.top + s.height / 2)) : Math.abs(c.left + c.width / 2 - (s.left + s.width / 2)), v = m > 0 ? Math.min(_ / m, 1) : 0, y = getComputedStyle(r), S = y.getPropertyValue("--tab-indicator-max-stretch").trim();
112
- D = t(r, Number(S) || 1.11), O.squish(v);
113
- let C = y.getPropertyValue("--eyeglass-span-max").trim(), w = C !== "" && x() === "plate";
114
- if (w) {
115
- let e = t(r, Number(C) || 1.6), n = (e) => b.value ? {
116
- start: e.top,
117
- end: e.bottom
118
- } : {
119
- start: e.left,
120
- end: e.right
121
- }, i = o ? b.value ? {
122
- start: o.top + (l.value?.clientTop ?? 0),
123
- end: o.bottom
124
- } : {
125
- start: o.left + (l.value?.clientLeft ?? 0),
126
- end: o.right
127
- } : void 0, a = d({
128
- from: n(s),
129
- to: n(c),
130
- track: i,
131
- spanMax: e
132
- });
133
- r.style.setProperty("--eyeglass-origin", `${p(a.direction)}%`), r.style.setProperty("--eyeglass-span", String(a.span)), r.style.setProperty("--eyeglass-swell", String(f(v))), a.clamped ? r.dataset.eyeglassClamped = "" : delete r.dataset.eyeglassClamped, l.value?.setAttribute("data-eyeglass-wake", "");
134
- }
135
- n(r, O.flexVel.value), E && clearTimeout(E), r.style.setProperty("--stretch", String(O.stretch.value));
136
- let j = A(r) * h;
137
- E = setTimeout(() => {
138
- O.squish(0), r.style.setProperty("--stretch", String(O.stretch.value)), w && (r.style.setProperty("--eyeglass-span", "1"), r.style.setProperty("--eyeglass-swell", "1"), delete r.dataset.eyeglassClamped, l.value?.removeAttribute("data-eyeglass-wake")), n(r, 0), E = null;
139
- }, j);
140
- }
141
- c(() => v.value, () => i(w)), c(() => _.value, () => i(w), { deep: !0 }), c(() => b.value, () => i(w));
142
- let M = null;
143
- return c(l, (e) => {
144
- M?.disconnect(), e ? (M = new ResizeObserver(w), M.observe(e), i(w)) : w();
145
- }, { flush: "post" }), a(() => {
146
- T = _.value.findIndex((e) => y.value.includes(e.value)), i(w);
147
- }), o(() => {
148
- M?.disconnect(), E && clearTimeout(E);
149
- }), {
150
- singleSliderStyle: S,
151
- squishOnTravel: j
152
- };
153
- }
154
- //#endregion
155
- //#region src/components/tabs/composables/useTabRovingFocus.ts
156
- function _(e) {
157
- let { stripOptions: t, stripValue: n, isVertical: i, activation: a, buttonRefs: o, select: l } = e, u = r(() => {
158
- let e = t.value.findIndex((e) => e.value === n.value);
159
- return e >= 0 && !t.value[e]?.disabled ? e : t.value.findIndex((e) => !e.disabled);
160
- }), d = s(u.value);
161
- c(r(() => [n.value ?? "", ...t.value.map((e) => `${e.value}:${e.disabled ? "1" : "0"}`)].join("\0")), () => {
162
- let e = typeof document > "u" ? null : document.activeElement, n = o.value.findIndex((n, r) => n === e && !t.value[r]?.disabled);
163
- d.value = n >= 0 ? n : u.value;
164
- }, { flush: "post" });
165
- let f = r(() => a.value === "manual" && d.value >= 0 && !t.value[d.value]?.disabled ? d.value : u.value);
166
- function p(e) {
167
- return e === f.value ? 0 : -1;
168
- }
169
- function m(e) {
170
- let n = t.value[e];
171
- !n || n.disabled || (d.value = e, o.value[e]?.focus(), a.value === "automatic" && l(n.value, e));
172
- }
173
- function h(e, n) {
174
- let r = t.value.length;
175
- if (r !== 0) for (let i = 1; i <= r; i++) {
176
- let a = (e + n * i + r * i) % r, o = t.value[a];
177
- if (o && !o.disabled) {
178
- m(a);
179
- return;
180
- }
181
- }
182
- }
183
- function g(e) {
184
- let n = t.value.length, r = e === "first" ? Array.from({ length: n }, (e, t) => t) : Array.from({ length: n }, (e, t) => n - 1 - t);
185
- for (let e of r) {
186
- let n = t.value[e];
187
- if (n && !n.disabled) {
188
- m(e);
189
- return;
190
- }
191
- }
192
- }
193
- function _(e) {
194
- let n = o.value.indexOf(e.target), r = n >= 0 && !t.value[n]?.disabled ? n : f.value, s = i.value ? "ArrowDown" : "ArrowRight", c = i.value ? "ArrowUp" : "ArrowLeft", u = e.currentTarget, p = u ? getComputedStyle(u).direction : "", m = u?.closest("[dir]")?.getAttribute("dir")?.toLowerCase(), _ = !i.value && (p === "rtl" || m === "rtl") ? -1 : 1;
195
- switch (e.key) {
196
- case s:
197
- e.preventDefault(), h(r, _);
198
- break;
199
- case c:
200
- e.preventDefault(), h(r, _ === 1 ? -1 : 1);
201
- break;
202
- case "Home":
203
- e.preventDefault(), g("first");
204
- break;
205
- case "End":
206
- e.preventDefault(), g("last");
207
- break;
208
- case "Enter":
209
- case " ": {
210
- if (a.value !== "manual") break;
211
- e.preventDefault();
212
- let n = t.value[r];
213
- n && !n.disabled && (d.value = r, l(n.value, r));
214
- break;
215
- }
216
- default: break;
217
- }
218
- }
219
- return {
220
- activeIndex: u,
221
- rovingTabindex: p,
222
- onStripKeydown: _
223
- };
224
- }
225
- //#endregion
226
- //#region src/composables/motion/morph/useSelectionGroup.ts
227
- function v(e, t) {
228
- return e == null ? t : typeof e == "object" && "value" in e ? e.value : e;
229
- }
230
- function y(e) {
231
- let { options: t, model: n, containerRef: i, buttonRefs: a, indicatorRef: o, vertical: s } = e, c = r(() => v(e.mode, "single")), l = r(() => v(e.role, c.value === "multiple" ? "group" : "radiogroup")), u = r(() => s?.value ?? !1), d = r(() => v(e.activation, "automatic")), f = r(() => {
232
- let e = n.value;
233
- return e == null ? [] : Array.isArray(e) ? e : [e];
234
- });
235
- function p(e) {
236
- return f.value.includes(e);
237
- }
238
- let m = r(() => f.value[0]), h = r(() => e.deform?.value ?? (c.value === "multiple" ? "none" : "plate")), { singleSliderStyle: y, squishOnTravel: b } = g({
239
- containerRef: i,
240
- indicatorRef: o ?? { value: null },
241
- buttonRefs: a,
242
- options: t,
243
- model: m,
244
- activeValues: f,
245
- vertical: u,
246
- deform: h
247
- });
248
- function x(r, i) {
249
- if (!t.value[i]?.disabled) {
250
- if (e.onSelect?.(r, i), c.value === "multiple") {
251
- let e = Array.isArray(n.value) ? [...n.value] : [], t = e.indexOf(r);
252
- t >= 0 ? e.splice(t, 1) : e.push(r), n.value = e;
253
- } else n.value = r;
254
- b(i), a.value[i]?.scrollIntoView({
255
- inline: "nearest",
256
- block: "nearest"
257
- });
258
- }
259
- }
260
- let { rovingTabindex: S, onStripKeydown: C } = _({
261
- stripOptions: t,
262
- stripValue: m,
263
- isVertical: u,
264
- activation: d,
265
- buttonRefs: a,
266
- select: x
267
- });
268
- function w(e) {
269
- let t = p(e), n = l.value;
270
- return n === "radiogroup" ? {
271
- role: "radio",
272
- "aria-checked": t ? "true" : "false"
273
- } : n === "tablist" ? {
274
- role: "tab",
275
- "aria-selected": t ? "true" : "false"
276
- } : { "aria-pressed": t ? "true" : "false" };
277
- }
278
- return {
279
- activeValues: f,
280
- isSelected: p,
281
- select: x,
282
- rovingTabindex: S,
283
- onKeydown: C,
284
- singleSliderStyle: y,
285
- squishOnTravel: b,
286
- groupRole: l,
287
- itemAttrs: w
288
- };
289
- }
290
- //#endregion
291
- export { g as i, m as n, h as r, y as t };
@@ -1,73 +0,0 @@
1
- import { t as e } from "./useSpring-9u2_shxV.js";
2
- import { n as t } from "./springPresets-Cbe0Voqg.js";
3
- import { computed as n, nextTick as r, onMounted as i, onScopeDispose as a, readonly as o, ref as s, watch as c } from "vue";
4
- //#region src/composables/motion/spring/useSpringMount.ts
5
- var l = Object.fromEntries([
6
- "present",
7
- "panel",
8
- "bloom"
9
- ].map((e) => {
10
- let { response: n, dampingFraction: r } = t(e);
11
- return [e, {
12
- response: n,
13
- dampingFraction: r
14
- }];
15
- }));
16
- function u(t) {
17
- let u = l[t.preset ?? "panel"], d = s(1), f = s(t.open.value), p = s(!1), m = 0, h = 0, g = null, _ = !1, v = e(d, {
18
- response: u.response,
19
- dampingFraction: u.dampingFraction,
20
- initial: 1,
21
- settleThreshold: .001,
22
- velocitySettleThreshold: .001,
23
- respectReducedMotion: t.respectReducedMotion !== !1
24
- });
25
- i(() => {
26
- t.open.value && r(() => {
27
- d.value = 0;
28
- });
29
- });
30
- let y = c(() => t.open.value, (e, t) => {
31
- e !== t && (e && (f.value = !0), !p.value && (d.value = +!e));
32
- }, { immediate: !1 }), b = c(() => v.isSettled.value, (e) => {
33
- e && _ && d.value >= 1 && (_ = !1, t.onDismiss?.());
34
- }), x = c(() => v.isSettled.value && v.value.value >= 1 && !t.open.value, (e) => {
35
- e && (f.value = !1);
36
- });
37
- function S(e) {
38
- if (e.button !== 0) return;
39
- let t = e.currentTarget;
40
- h = t.getBoundingClientRect().height || 1, m = e.clientY, g = e.pointerId, p.value = !0, t.setPointerCapture(e.pointerId);
41
- }
42
- function C(e) {
43
- if (!p.value || e.pointerId !== g) return;
44
- let t = e.clientY - m;
45
- if (t <= 0) {
46
- d.value = 0;
47
- return;
48
- }
49
- d.value = Math.min(1, t / h);
50
- }
51
- function w(e) {
52
- if (!p.value || e.pointerId !== g) return;
53
- let n = e.currentTarget;
54
- n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), p.value = !1, g = null;
55
- let r = t.dismissThreshold ?? .3;
56
- d.value >= r ? (_ = !0, d.value = 1) : d.value = 0;
57
- }
58
- return a(() => {
59
- y(), b(), x();
60
- }), {
61
- position: v.value,
62
- present: o(f),
63
- isDragging: n(() => p.value),
64
- dragHandlers: {
65
- onPointerdown: S,
66
- onPointermove: C,
67
- onPointerup: w,
68
- onPointercancel: w
69
- }
70
- };
71
- }
72
- //#endregion
73
- export { u as t };