@mkbabb/glass-ui 10.1.5 → 11.0.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 (214) 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/dialog/DialogContent.vue.d.ts +2 -2
  44. package/dist/components/dialog/ModalOverlay.vue.d.ts +2 -2
  45. package/dist/components/dialog/ModalScrim.vue.d.ts +26 -0
  46. package/dist/components/dialog/styles.css +1 -1
  47. package/dist/components/dock/GlassDock.vue.d.ts +4 -1
  48. package/dist/components/dock/composables/useDockShellProps.d.ts +34 -2
  49. package/dist/components/dock/composables/useDockState.d.ts +5 -0
  50. package/dist/components/dock/index.d.ts +1 -2
  51. package/dist/components/dock/styles/controls/icon-button.css +1 -1
  52. package/dist/components/dock/styles/controls/tab-button.css +1 -1
  53. package/dist/components/dock/styles/morph.css +1 -1
  54. package/dist/components/dock/styles/run.css +1 -1
  55. package/dist/components/dock/styles/shell.css +1 -1
  56. package/dist/components/dock/trigger.d.ts +1 -0
  57. package/dist/components/expandable-container/ExpandableContainer.vue.d.ts +30 -29
  58. package/dist/components/menu/ContextMenu.vue.d.ts +27 -0
  59. package/dist/components/menu/DropdownMenu.vue.d.ts +5 -23
  60. package/dist/components/menu/context.d.ts +18 -5
  61. package/dist/components/menu/family-click.d.ts +2 -0
  62. package/dist/components/menu/family-context.d.ts +2 -0
  63. package/dist/components/menu/index.d.ts +1 -1
  64. package/dist/components/sheet/SheetContent.vue.d.ts +2 -2
  65. package/dist/components/sortable-list/styles.css +1 -0
  66. package/dist/components/surface/Surface.vue.d.ts +4 -1
  67. package/dist/components/tabs/composables/useTabDragMorph.d.ts +4 -7
  68. package/dist/components/tabs/styles/segmented.css +1 -1
  69. package/dist/components/tabs/types.d.ts +7 -8
  70. package/dist/composables/glass/fieldPaint.d.ts +4 -0
  71. package/dist/composables/glass/useGlassBackdropLuminance.d.ts +7 -6
  72. package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +8 -0
  73. package/dist/composables/motion/core/motionTempo.d.ts +2 -1
  74. package/dist/composables/motion/morph/useDragMorph.d.ts +2 -2
  75. package/dist/composables/motion/morph/useSelectionGroup.d.ts +6 -25
  76. package/dist/composables/motion/morph/useSelectionIndicator.d.ts +8 -54
  77. package/dist/composables/motion/spring/useLiquidFlex.d.ts +3 -5
  78. package/dist/composables/motion/spring/useSpringMount.d.ts +0 -9
  79. package/dist/{configurator-Dl10mc3L.js → configurator-C1ZKEf1b.js} +7 -5
  80. package/dist/configurator.css +1 -0
  81. package/dist/configurator.js +1 -1
  82. package/dist/constants-DfrO-IaH.js +8 -0
  83. package/dist/constellation.css +1 -0
  84. package/dist/constellation.js +2 -1
  85. package/dist/control.css +1 -0
  86. 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
  87. package/dist/{createCanvasLifecycle-hJHobVTn.js → createCanvasLifecycle-DS0vEs_G.js} +76 -75
  88. package/dist/dark-mode-toggle.js +1 -1
  89. package/dist/{data-table-8y6fbyOB.js → data-table-CunuMkZ3.js} +1 -0
  90. package/dist/data-table.css +1 -0
  91. package/dist/data-table.js +1 -1
  92. package/dist/{deck-Cm_VmyNL.js → deck-Bc-2mEKE.js} +1 -0
  93. package/dist/deck.js +1 -1
  94. package/dist/dialog.js +1 -1
  95. package/dist/dock-trigger.d.ts +1 -0
  96. package/dist/dock-trigger.js +88 -0
  97. package/dist/dock.js +685 -729
  98. package/dist/easing.js +4 -4
  99. package/dist/expandable-container-wS1awXGd.js +135 -0
  100. package/dist/expandable-container.css +1 -0
  101. package/dist/expandable-container.js +1 -1
  102. package/dist/{fading-scroll-ClCPooXb.js → fading-scroll-D3Y20ibL.js} +1 -1
  103. package/dist/fading-scroll.js +1 -1
  104. package/dist/fieldPaint-Ci77oajZ.js +7 -0
  105. package/dist/fourier-field.css +1 -0
  106. package/dist/fourier-field.js +15 -13
  107. package/dist/glSetup-DMaDgrEj.js +577 -0
  108. package/dist/glass-ui.js +66 -65
  109. package/dist/handmark.css +1 -0
  110. package/dist/handmark.js +82 -71
  111. package/dist/index.css +1 -0
  112. package/dist/index.d.ts +1 -1
  113. package/dist/{input-eLZ_AU7l.js → input-BLF2pMHE.js} +1 -1
  114. package/dist/input.js +1 -1
  115. package/dist/{label-CE03H1KL.js → label-ryNPL7e6.js} +1 -0
  116. package/dist/label.css +1 -0
  117. package/dist/label.js +1 -1
  118. package/dist/labeled-field.css +1 -0
  119. package/dist/labeled-field.js +5 -4
  120. package/dist/{menu-DaYAZiVW.js → menu-C_l2Sslf.js} +162 -112
  121. package/dist/menu.js +3 -3
  122. package/dist/metric.js +1 -0
  123. package/dist/motion-core.js +138 -44
  124. package/dist/motion-lHDAQHEE.js +91 -0
  125. package/dist/motion.js +5 -5
  126. package/dist/motionTempo-DXdVbCWr.js +13 -0
  127. package/dist/music-staff.js +1 -0
  128. package/dist/{number-field-RP89046a.js → number-field-BXFUP49Z.js} +3 -2
  129. package/dist/number-field.css +1 -0
  130. package/dist/number-field.js +1 -1
  131. package/dist/pager-dots.css +1 -0
  132. package/dist/pager-dots.js +3 -2
  133. package/dist/participation-C5y5VZTN.js +52 -0
  134. package/dist/{popover-BdpoE4Ar.js → popover-DQUmwuAa.js} +3 -2
  135. package/dist/popover.js +1 -1
  136. package/dist/{progress-eVa-mc7J.js → progress-BUn0Bw7Z.js} +1 -0
  137. package/dist/progress.css +1 -0
  138. package/dist/progress.js +1 -1
  139. package/dist/{radio-group-B58Bz16F.js → radio-group-xdEy2tdi.js} +1 -0
  140. package/dist/radio-group.css +1 -0
  141. package/dist/radio-group.js +1 -1
  142. package/dist/root-scroll-lock-DJFrQhMa.js +22 -0
  143. package/dist/select-Dt5dXm87.js +309 -0
  144. package/dist/select.js +1 -1
  145. package/dist/{separator-D4EZM10u.js → separator-C4y9p_ky.js} +1 -0
  146. package/dist/separator.css +1 -0
  147. package/dist/separator.js +1 -1
  148. package/dist/sheet-DLqNUIZl.js +347 -0
  149. package/dist/sheet-width-DgXgJNa5.js +18 -0
  150. package/dist/sheet.js +2 -2
  151. package/dist/{slider-Dg3Qqdyo.js → slider-B4w12E_u.js} +8 -8
  152. package/dist/slider.js +1 -1
  153. package/dist/sortable-list.js +2 -1
  154. package/dist/{status-dot-W4LFiJps.js → status-dot-BDZKcRxy.js} +2 -1
  155. package/dist/status-dot.css +1 -0
  156. package/dist/status-dot.js +1 -1
  157. package/dist/styles/components.css +1 -1
  158. package/dist/styles/glass/glass-capsule.css +1 -1
  159. package/dist/styles/glass/glass-chip.css +1 -1
  160. package/dist/styles/glass/mark.css +1 -1
  161. package/dist/styles/glass/overlay-plate.css +1 -1
  162. package/dist/styles/glass/surface-axis.css +1 -1
  163. package/dist/styles/index.css +1 -1
  164. package/dist/styles/theme/radius.css +1 -1
  165. package/dist/styles/tokens/color-radius.css +1 -1
  166. package/dist/styles/tokens/manifest.d.ts +1 -1
  167. package/dist/styles/tokens/scale-paper.css +1 -1
  168. package/dist/styles/utilities/base-misc.css +1 -1
  169. package/dist/surface.js +1 -1
  170. package/dist/{switch-BYUZ6g9G.js → switch-DLfGYU35.js} +1 -0
  171. package/dist/switch.css +1 -0
  172. package/dist/switch.js +1 -1
  173. package/dist/tabs-NgTRPGZx.js +229 -0
  174. package/dist/tabs.js +1 -1
  175. package/dist/textarea.js +1 -1
  176. package/dist/timeline.css +1 -0
  177. package/dist/timeline.js +4 -3
  178. package/dist/toggle-group-DgXcJGD6.js +129 -0
  179. package/dist/toggle-group.css +1 -0
  180. package/dist/toggle-group.js +1 -1
  181. package/dist/tokens.js +2 -0
  182. package/dist/{tooltip-CZVubnJf.js → tooltip-Do3qCw0r.js} +1 -1
  183. package/dist/tooltip.js +1 -1
  184. package/dist/typewriter.css +1 -0
  185. package/dist/typewriter.js +1 -0
  186. package/dist/uniformBridge-CJyy7NOn.js +150 -0
  187. package/dist/useBarShape-CmP35Z8o.js +24 -0
  188. package/dist/{useCanvas2D-CQRElMyE.js → useCanvas2D-Bhpwua98.js} +1 -1
  189. package/dist/{useDockCtaReceive-BSSgD6mu.js → useDockCtaReceive-Dn_-paqP.js} +1 -1
  190. package/dist/{useDragMorph-B363RUbF.js → useDragMorph-BEI74U0t.js} +51 -40
  191. package/dist/{color.wgsl-BTszLY39.js → useGpuSubstrate-Y5XAdU8d.js} +7 -7
  192. package/dist/{useLiquidPress-h1scrPtP.js → useLiquidPress-D5mjZC6U.js} +2 -2
  193. package/dist/useScrollChrome-DMP6kDI9.js +67 -0
  194. package/dist/useSelectionGroup-DAQv5Lb5.js +186 -0
  195. package/dist/{useSpring-9u2_shxV.js → useSpring-Aof0nTRt.js} +1 -1
  196. package/dist/useSpringMount-jgNkymRl.js +73 -0
  197. package/dist/wgpuSetup-CFuqd_RP.js +1278 -0
  198. package/package.json +8 -1
  199. package/dist/DialogContent-CwIBvou_.js +0 -157
  200. package/dist/DropdownMenuTrigger-CKRnhDSQ.js +0 -93
  201. package/dist/button-BOFTUPyU.js +0 -110
  202. package/dist/composables/motion/morph/eyeglass.d.ts +0 -141
  203. package/dist/expandable-container-CZUj9BzY.js +0 -142
  204. package/dist/glass-ui.css +0 -2
  205. package/dist/motion-BvV1_24p.js +0 -61
  206. package/dist/motionTempo-tscp92Nm.js +0 -7
  207. package/dist/participation-B7UFdgXB.js +0 -55
  208. package/dist/select-BiF0FCZf.js +0 -292
  209. package/dist/sheet-DmJxgAHc.js +0 -345
  210. package/dist/tabs-C5sC0fBE.js +0 -269
  211. package/dist/toggle-group-CC5b3o1R.js +0 -125
  212. package/dist/useScrollChrome-BJbWV32F.js +0 -162
  213. package/dist/useSelectionGroup-zsEwitF6.js +0 -291
  214. package/dist/useSpringMount-OA-0mTNv.js +0 -73
@@ -1,345 +0,0 @@
1
- import { t as e } from "./class-names-FlXcvRRT.js";
2
- import { t } from "./motionTempo-tscp92Nm.js";
3
- import { n } from "./springPresets-Cbe0Voqg.js";
4
- import { t as r } from "./resolve-DdrNvBby.js";
5
- import { t as i } from "./useSpringMount-OA-0mTNv.js";
6
- import { i as a, n as o, r as s, t as c } from "./motion-BvV1_24p.js";
7
- import { t as l } from "./useMotionAxis-D-rtIhca.js";
8
- import { t as u } from "./shortcuts-DGGWNRNe.js";
9
- import { computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createVNode as g, defineComponent as _, mergeProps as v, normalizeStyle as y, onScopeDispose as b, openBlock as x, ref as S, renderSlot as C, unref as w, watch as T, withCtx as E } from "vue";
10
- import { DialogClose as D, DialogContent as O, DialogPortal as k, injectDialogRootContext as A, useForwardPropsEmits as j } from "reka-ui";
11
- import { SpringProgress as M } from "@mkbabb/keyframes.js";
12
- //#region src/components/sheet/detents/projection.ts
13
- function N(e) {
14
- return 2 * Math.PI / e;
15
- }
16
- function P(e) {
17
- let t = N(e.response), n = e.dampingFraction * t;
18
- return !Number.isFinite(n) || n <= 0 ? 0 : -Math.log(e.settleBand) / n;
19
- }
20
- function F(e, t) {
21
- return e * P(t);
22
- }
23
- function I(e, t, n) {
24
- return e + F(t, n);
25
- }
26
- function L(e, t) {
27
- let n = t[0], r = Math.abs(e - n);
28
- for (let i of t) {
29
- let t = Math.abs(e - i);
30
- t < r && (n = i, r = t);
31
- }
32
- return n;
33
- }
34
- function R(e, t, n, r) {
35
- return L(I(e, t, r), [0, ...n]);
36
- }
37
- //#endregion
38
- //#region src/components/sheet/detents/use.ts
39
- var z = {
40
- travel: "bloom",
41
- rung: "dock"
42
- }, B = "button, a[href], input, select, textarea, [contenteditable=true]", V = "[data-slot=\"sheet-detent-handle\"], [data-slot=\"dialog-header\"]";
43
- function H(e, t) {
44
- switch (e) {
45
- case "bottom": return -t.clientY;
46
- case "top": return t.clientY;
47
- case "left": return t.clientX;
48
- case "right": return -t.clientX;
49
- }
50
- }
51
- function U(e) {
52
- return typeof window > "u" ? 1 : (e === "left" || e === "right" ? window.innerWidth : window.innerHeight) || 1;
53
- }
54
- function W(e, t) {
55
- let n = e instanceof Element ? e : null;
56
- for (; n && n !== t;) {
57
- if (n.scrollHeight > n.clientHeight && n.scrollTop > 0) return !1;
58
- n = n.parentElement;
59
- }
60
- return !0;
61
- }
62
- function G(e) {
63
- let { open: r, side: i, ladder: a, detent: o, requestClose: s } = e, c = S(0), l = S(r.value), u = S(!1), d = null, f = null, p = 1;
64
- function m(e, t, r) {
65
- let i = n(z[e]);
66
- return d?.dispose(), d = new M({
67
- response: i.response * p,
68
- dampingFraction: i.dampingFraction,
69
- initial: t,
70
- initialVelocity: r,
71
- respectReducedMotion: !0
72
- }), f = e, d;
73
- }
74
- function h(e) {
75
- c.value = e, !r.value && d?.target === 0 && d.settled && (l.value = !1);
76
- }
77
- function g(e, t) {
78
- let n = c.value, r = d?.velocity ?? 0, i = d && f === t ? d : m(t, n, r);
79
- i.target = e, i.play(h), e > 0 && (o.value = e);
80
- }
81
- function _(e) {
82
- g(L(e, a()), "rung");
83
- }
84
- function v() {
85
- let e = a(), t = o.value;
86
- return typeof t == "number" && Number.isFinite(t) ? L(t, e) : e[e.length - 1];
87
- }
88
- let y = null, x = null, C = 0, w = 0, E = 0, D = 0, O = 0, k = 1;
89
- function A(e) {
90
- if (e.button !== 0 || y !== null) return;
91
- let t = e.currentTarget;
92
- if (!t) return;
93
- let n = e.target instanceof Element ? e.target : null;
94
- n && (n.closest(B) && !n.closest(V) || !n.closest(V) && !W(n, t) || (d?.stop(), x = t, y = e.pointerId, u.value = !0, k = U(i()), C = H(i(), e), E = C, D = e.timeStamp, w = c.value, O = 0, t.setPointerCapture?.(e.pointerId), t.addEventListener("pointermove", j), t.addEventListener("pointerup", N), t.addEventListener("pointercancel", N)));
95
- }
96
- function j(e) {
97
- if (e.pointerId !== y) return;
98
- let t = H(i(), e), n = (e.timeStamp - D) / 1e3;
99
- n > 0 && (O = (t - E) / n / k), E = t, D = e.timeStamp;
100
- let r = a(), o = r[r.length - 1];
101
- c.value = Math.min(o, Math.max(0, w + (t - C) / k));
102
- }
103
- function N(e) {
104
- if (e.pointerId !== y) return;
105
- P();
106
- let t = n(z.rung), r = R(c.value, O, a(), {
107
- response: t.response * p,
108
- dampingFraction: t.dampingFraction,
109
- settleBand: t.settleBand
110
- });
111
- if (r === 0) {
112
- s(), g(0, "travel");
113
- return;
114
- }
115
- g(r, "rung");
116
- }
117
- function P() {
118
- y === null || !x || (x.releasePointerCapture?.(y), x.removeEventListener("pointermove", j), x.removeEventListener("pointerup", N), x.removeEventListener("pointercancel", N), y = null, u.value = !1, x = null);
119
- }
120
- return T(r, (e) => {
121
- if (e) {
122
- l.value = !0, p = t(), d || (c.value = 0, m("travel", 0, 0)), g(v(), "travel");
123
- return;
124
- }
125
- if (l.value) {
126
- if (P(), !d) {
127
- c.value = 0, l.value = !1;
128
- return;
129
- }
130
- g(0, "travel"), d.settled && (l.value = !1);
131
- }
132
- }, {
133
- immediate: !0,
134
- flush: "sync"
135
- }), T(o, (e) => {
136
- if (!r.value || u.value || typeof e != "number" || !Number.isFinite(e)) return;
137
- let t = L(e, a());
138
- (!d || Math.abs(d.target - t) > .001) && g(t, "rung");
139
- }), b(() => {
140
- P(), d?.dispose(), d = null;
141
- }), {
142
- t: c,
143
- present: l,
144
- dragging: u,
145
- snapTo: _,
146
- onPointerdown: A
147
- };
148
- }
149
- //#endregion
150
- //#region src/components/sheet/SheetContent.vue?vue&type=script&setup=true&lang.ts
151
- var K = [
152
- "aria-orientation",
153
- "aria-valuemin",
154
- "aria-valuemax",
155
- "aria-valuenow",
156
- "aria-valuetext"
157
- ], ee = { "data-slot": "sheet-content-region" }, te = [
158
- "data-side",
159
- "data-detents",
160
- "data-modal"
161
- ], ne = "calc(var(--glass-veil-crown) + (var(--glass-veil-sheet) - var(--glass-veil-crown)) * clamp(0, var(--detent-t), 1))", q = /* @__PURE__ */ _({
162
- inheritAttrs: !1,
163
- __name: "SheetContent",
164
- props: {
165
- forceMount: { type: Boolean },
166
- disableOutsidePointerEvents: { type: Boolean },
167
- class: { type: [
168
- Boolean,
169
- null,
170
- String,
171
- Object,
172
- Array
173
- ] },
174
- surface: { default: "glass" },
175
- side: { default: "right" },
176
- detents: { default: void 0 },
177
- detent: { default: void 0 },
178
- motion: {},
179
- scroll: {
180
- type: Boolean,
181
- default: !1
182
- }
183
- },
184
- emits: [
185
- "escapeKeyDown",
186
- "pointerDownOutside",
187
- "focusOutside",
188
- "interactOutside",
189
- "openAutoFocus",
190
- "closeAutoFocus",
191
- "update:detent"
192
- ],
193
- setup(t, { emit: n }) {
194
- let _ = t, b = n, M = d(() => {
195
- let { class: e, surface: t, side: n, motion: r, scroll: i, detents: a, detent: o, forceMount: s, ...c } = _;
196
- return c;
197
- }), N = l(() => _.motion), P = d(() => N.resolved.value !== "off"), F = d(() => _.detents ? [..._.detents].sort((e, t) => e - t) : []), I = d(() => F.value.length > 0), L = {
198
- top: "border-b",
199
- bottom: "border-t",
200
- left: "border-r",
201
- right: "border-l"
202
- }, R = d(() => e("fixed", L[_.side], r("floating"), _.class)), z = A();
203
- u(() => z.open.value && z.modal.value);
204
- let B = i({
205
- open: d(() => !I.value && z.open.value),
206
- preset: "panel"
207
- }), V = S(_.detent ?? null);
208
- T(() => _.detent, (e) => {
209
- e !== void 0 && (V.value = e);
210
- }), T(V, (e) => b("update:detent", e));
211
- let H = G({
212
- open: z.open,
213
- side: () => _.side,
214
- ladder: () => F.value.length > 0 ? F.value : [1],
215
- detent: V,
216
- requestClose: () => z.onOpenChange(!1)
217
- }), U = d(() => {
218
- if (P.value) return I.value ? { "--detent-t": String(H.t.value) } : {
219
- translate: s(_.side, B.position.value),
220
- transform: "none",
221
- animation: "none",
222
- transition: "none"
223
- };
224
- }), W = d(() => I.value ? H.present.value : B.present.value), q = d(() => P.value ? W.value || z.open.value : _.forceMount), J = d(() => _.surface === "glass" && (q.value || z.open.value)), Y = d(() => P.value && !z.open.value ? "" : void 0), X = d(() => P.value ? I.value ? c(H.t.value) : o(B.position.value) : null), re = d(() => P.value ? W.value || z.open.value : void 0), Z = d(() => {
225
- let e = F.value, t = H.dragging.value ? H.t.value : V.value ?? H.t.value, n = 0;
226
- for (let r = 1; r < e.length; r += 1) Math.abs(e[r] - t) < Math.abs(e[n] - t) && (n = r);
227
- return n;
228
- }), ie = d(() => {
229
- let e = F.value;
230
- return `${Math.round((e[Z.value] ?? 1) * 100)}%, position ${Z.value + 1} of ${e.length}`;
231
- }), ae = d(() => I.value ? { "--detent-t": String(H.t.value) } : void 0);
232
- function Q(e) {
233
- let t = F.value, n = t.length - 1, r = Z.value;
234
- if (e.key === "Home") r = 0;
235
- else if (e.key === "End") r = n;
236
- else if (e.key === "ArrowUp" || e.key === "ArrowRight") r = Math.min(n, r + 1);
237
- else if (e.key === "ArrowDown" || e.key === "ArrowLeft") r = Math.max(0, r - 1);
238
- else return;
239
- e.preventDefault(), H.snapTo(t[r]);
240
- }
241
- let $ = S(null), oe = () => $.value?.closest("[data-slot=\"sheet-content\"]") ?? null;
242
- T(() => z.open.value, (e) => {
243
- if (!P.value || e !== !1) return;
244
- let t = document.activeElement;
245
- t && oe()?.contains(t) && z.triggerElement.value?.focus({ preventScroll: !0 });
246
- }, { flush: "sync" });
247
- let se = j(M, b), ce = d(() => ({
248
- "--glass-veil-tier": I.value ? ne : "var(--glass-veil-dialog)",
249
- "--radius-ctx": "var(--radius-3xl)",
250
- "--radius-inset": "var(--space-family)",
251
- ...N.hostStyle.value ?? {},
252
- ...U.value ?? {}
253
- }));
254
- return (e, t) => (x(), f(w(k), { "force-mount": q.value }, {
255
- default: E(() => [
256
- g(a, {
257
- opacity: X.value,
258
- "force-mount": re.value
259
- }, null, 8, ["opacity", "force-mount"]),
260
- g(w(O), v({
261
- ...w(se),
262
- ...e.$attrs,
263
- inert: Y.value
264
- }, {
265
- "aria-modal": w(z).modal.value ? "true" : void 0,
266
- "force-mount": q.value,
267
- class: R.value,
268
- style: ce.value,
269
- "data-surface": _.surface,
270
- "data-slot": "sheet-content",
271
- "data-side": _.side,
272
- "data-modal": w(z).modal.value ? void 0 : "false",
273
- "data-detents": I.value ? "" : void 0,
274
- "data-dragging": w(H).dragging.value ? "" : void 0,
275
- "data-scroll": _.scroll ? "" : void 0,
276
- "data-motion": w(N).dataMotion.value,
277
- onPointerdown: t[0] ||= (e) => I.value ? w(H).onPointerdown(e) : void 0
278
- }), {
279
- default: E(() => [
280
- h("span", {
281
- ref_key: "contentAnchorEl",
282
- ref: $,
283
- hidden: ""
284
- }, null, 512),
285
- g(w(D), { "data-slot": "dialog-close" }, {
286
- default: E(() => [...t[1] ||= [h("svg", {
287
- class: "w-4 h-4",
288
- viewBox: "0 0 24 24",
289
- fill: "none",
290
- stroke: "currentColor",
291
- "stroke-width": "2",
292
- "stroke-linecap": "round",
293
- "stroke-linejoin": "round",
294
- "aria-hidden": "true"
295
- }, [h("path", { d: "M18 6 6 18M6 6l12 12" })], -1), h("span", { class: "sr-only" }, "Close", -1)]]),
296
- _: 1
297
- }),
298
- I.value ? (x(), m("div", {
299
- key: 0,
300
- "data-slot": "sheet-detent-handle",
301
- role: "slider",
302
- tabindex: "0",
303
- "aria-label": "Sheet position",
304
- "aria-orientation": _.side === "left" || _.side === "right" ? "horizontal" : "vertical",
305
- "aria-valuemin": F.value[0],
306
- "aria-valuemax": F.value[F.value.length - 1],
307
- "aria-valuenow": F.value[Z.value],
308
- "aria-valuetext": ie.value,
309
- onKeydown: Q
310
- }, [h("span", {
311
- "data-slot": "sheet-detent-grip",
312
- style: y(ae.value),
313
- "aria-hidden": "true"
314
- }, null, 4)], 40, K)) : p("", !0),
315
- h("div", ee, [C(e.$slots, "default")])
316
- ]),
317
- _: 3
318
- }, 16, [
319
- "aria-modal",
320
- "force-mount",
321
- "class",
322
- "style",
323
- "data-surface",
324
- "data-side",
325
- "data-modal",
326
- "data-detents",
327
- "data-dragging",
328
- "data-scroll",
329
- "data-motion"
330
- ]),
331
- J.value ? (x(), m("span", {
332
- key: 0,
333
- "data-slot": "glass-graded-halo",
334
- "data-side": _.side,
335
- "data-detents": I.value ? "" : void 0,
336
- "data-modal": w(z).modal.value ? void 0 : "false",
337
- "aria-hidden": "true"
338
- }, null, 8, te)) : p("", !0)
339
- ]),
340
- _: 3
341
- }, 8, ["force-mount"]));
342
- }
343
- });
344
- //#endregion
345
- export { R as a, F as c, I as i, G as n, P as o, L as r, N as s, q as t };
@@ -1,269 +0,0 @@
1
- import { t as e } from "./class-names-FlXcvRRT.js";
2
- import { n as t, r as n } from "./writeVelocityWeight-DoGOCW3e.js";
3
- import { t as r } from "./useMotionAxis-D-rtIhca.js";
4
- import { a as i, c as a, l as o, r as s, s as c } from "./select-BiF0FCZf.js";
5
- import { n as l, t as u } from "./useSelectionGroup-zsEwitF6.js";
6
- import { t as d } from "./useDragMorph-B363RUbF.js";
7
- import { Fragment as f, computed as p, createBlock as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, mergeModels as b, mergeProps as x, nextTick as S, normalizeClass as C, normalizeStyle as w, onBeforeUnmount as T, onBeforeUpdate as E, onMounted as D, openBlock as O, ref as k, renderList as A, renderSlot as j, toDisplayString as M, unref as N, useModel as P, watch as F, withCtx as I } from "vue";
8
- //#region src/components/tabs/composables/useTabDragMorph.ts
9
- function L(e) {
10
- let { indicatorRef: r, isVertical: i, isUnderline: a, draggable: o, stripOptions: s, buttonRefs: c, model: u } = e, f = p(() => o() && !a.value);
11
- function m() {
12
- let e = r.value;
13
- if (!e) return l;
14
- let n = getComputedStyle(e).getPropertyValue("--tab-indicator-max-stretch").trim();
15
- return t(e, Number(n) || 1.11);
16
- }
17
- function h() {
18
- return s.value.map((e, t) => {
19
- let n = c.value[t]?.getBoundingClientRect(), r = n ? i.value ? n.top + n.height / 2 : n.left + n.width / 2 : 0;
20
- return {
21
- value: e.value,
22
- center: r
23
- };
24
- });
25
- }
26
- let g = d({
27
- handle: r,
28
- axis: () => i.value ? "y" : "x",
29
- snapTargets: h,
30
- maxStretch: m,
31
- onSnap: (e) => {
32
- u.value !== e && (u.value = e);
33
- }
34
- });
35
- return F(() => [g.dragging.value, g.stretch.value], ([e, t]) => {
36
- let i = r.value;
37
- if (!(!i || !f.value)) if (e) {
38
- i.style.setProperty("--stretch", String(t));
39
- let e = m();
40
- n(i, e > 1 ? (t - 1) / (e - 1) : 0);
41
- } else i.style.removeProperty("--stretch"), n(i, 0);
42
- }), F(() => [
43
- r.value,
44
- s.value.length,
45
- i.value,
46
- f.value
47
- ], () => {
48
- f.value && r.value && S(() => g.refresh());
49
- }, { immediate: !0 }), {
50
- dragEnabled: f,
51
- drag: g
52
- };
53
- }
54
- //#endregion
55
- //#region src/components/tabs/composables/useTabResponsive.ts
56
- function R(e) {
57
- let { responsive: t, options: n, model: r } = e, i = p(() => {
58
- let e = t();
59
- return e === !1 ? null : e === !0 ? {} : e;
60
- }), a = p(() => i.value?.breakpoint ?? "640px"), o = p(() => i.value?.desktopOptions ?? n.value), s = k(!0), c = null;
61
- function l(e) {
62
- "currentTarget" in e && e.currentTarget && e.currentTarget !== c || (s.value = e.matches);
63
- }
64
- let u = p(() => {
65
- if (!i.value) return r.value;
66
- let e = o.value;
67
- return e.some((e) => e.value === r.value) ? r.value : e.find((e) => !e.disabled)?.value;
68
- }), d = p(() => i.value ? o.value : n.value), f = p(() => i.value?.ariaLabel ?? n.value.find((e) => e.value === r.value)?.label ?? "Select"), m = p(() => !!i.value && !s.value), h = !1;
69
- function g() {
70
- if (c?.removeEventListener("change", l), c = null, !h || !i.value || typeof window > "u" || !window.matchMedia) {
71
- s.value = !0;
72
- return;
73
- }
74
- c = window.matchMedia(`(min-width: ${a.value})`), s.value = c.matches, c.addEventListener("change", l);
75
- }
76
- return F([i, a], g), D(() => {
77
- h = !0, g();
78
- }), T(() => {
79
- h = !1, c?.removeEventListener("change", l), c = null;
80
- }), {
81
- responsiveCfg: i,
82
- breakpoint: a,
83
- desktopOptions: o,
84
- isDesktop: s,
85
- stripValue: u,
86
- stripOptions: d,
87
- mobileAriaLabel: f,
88
- showMobileSelect: m
89
- };
90
- }
91
- //#endregion
92
- //#region src/components/tabs/SegmentedTabs.vue?vue&type=script&setup=true&lang.ts
93
- var z = [
94
- "role",
95
- "aria-label",
96
- "aria-orientation",
97
- "data-motion"
98
- ], B = [
99
- "role",
100
- "tabindex",
101
- "disabled",
102
- "onClick"
103
- ], V = /* @__PURE__ */ y({
104
- __name: "SegmentedTabs",
105
- props: /*@__PURE__*/ b({
106
- options: {},
107
- ariaLabel: {},
108
- variant: { default: "pill" },
109
- semantics: {},
110
- activation: { default: "automatic" },
111
- orientation: { default: "horizontal" },
112
- responsive: {
113
- type: [Boolean, Object],
114
- default: !1
115
- },
116
- motion: {},
117
- class: { type: [
118
- Boolean,
119
- null,
120
- String,
121
- Object,
122
- Array
123
- ] }
124
- }, {
125
- modelValue: { required: !0 },
126
- modelModifiers: {}
127
- }),
128
- emits: ["update:modelValue"],
129
- setup(t) {
130
- function n(e, t) {
131
- return typeof document > "u" ? t : getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
132
- }
133
- let l = t, d = r(() => l.motion), y = P(t, "modelValue"), b = k(null), S = k(null), T = k([]), D = p(() => l.variant === "underline"), F = p(() => l.orientation === "vertical"), V = p(() => l.semantics === "tabs" || !l.semantics && D.value);
134
- function H(e) {
135
- return !D.value && !Q(e.value) && !e.disabled && "glass-capsule-hover";
136
- }
137
- let { responsiveCfg: U, stripValue: W, stripOptions: G, mobileAriaLabel: K, showMobileSelect: q } = R({
138
- responsive: () => l.responsive,
139
- options: p(() => l.options),
140
- model: y
141
- }), J = u({
142
- options: G,
143
- model: p({
144
- get: () => W.value ?? void 0,
145
- set: (e) => {
146
- e != null && (y.value = e);
147
- }
148
- }),
149
- role: p(() => V.value ? "tablist" : "group"),
150
- vertical: F,
151
- activation: p(() => l.activation),
152
- containerRef: b,
153
- indicatorRef: S,
154
- buttonRefs: T,
155
- deform: p(() => D.value ? "mark" : "plate"),
156
- onSelect: (e, t) => {
157
- let n = T.value[t];
158
- n && ne(n);
159
- }
160
- }), { select: Y, rovingTabindex: X, singleSliderStyle: ee } = J, Z = J.onKeydown, Q = (e) => J.isSelected(e);
161
- E(() => {
162
- T.value = [];
163
- });
164
- let { dragEnabled: $, drag: te } = L({
165
- indicatorRef: S,
166
- isVertical: F,
167
- isUnderline: D,
168
- draggable: () => d.armed.value,
169
- stripOptions: G,
170
- buttonRefs: T,
171
- model: y
172
- });
173
- function ne(e) {
174
- if (typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
175
- e.getAnimations().forEach((e) => e.cancel());
176
- let t = n("--spring-dock", "ease"), r = n("--scale-press-sm", "");
177
- e.animate([
178
- { transform: "scale(1)" },
179
- {
180
- transform: `scale(${r})`,
181
- offset: .4
182
- },
183
- { transform: "scale(1)" }
184
- ], {
185
- duration: 220,
186
- easing: t
187
- });
188
- }
189
- function re(e) {
190
- let t = l.options.find((t) => t.value === e);
191
- t && (y.value = t.value);
192
- }
193
- return (n, r) => N(q) ? (O(), h("div", {
194
- key: 0,
195
- class: C(N(e)("segmented-tabs__mobile w-fit", l.class))
196
- }, [v(N(o), {
197
- "model-value": y.value,
198
- "onUpdate:modelValue": re
199
- }, {
200
- default: I(() => [v(N(c), {
201
- "aria-label": l.ariaLabel ?? N(K),
202
- "data-control-target": "",
203
- class: C(N(e)("segmented-tabs__trigger text-small w-auto min-w-input-sm", N(U)?.triggerClass))
204
- }, {
205
- default: I(() => [v(N(a))]),
206
- _: 1
207
- }, 8, ["aria-label", "class"]), v(N(i), null, {
208
- default: I(() => [(O(!0), h(f, null, A(t.options, (e) => (O(), m(N(s), {
209
- key: e.value,
210
- value: e.value,
211
- disabled: e.disabled
212
- }, {
213
- default: I(() => [_(M(e.label), 1)]),
214
- _: 2
215
- }, 1032, ["value", "disabled"]))), 128))]),
216
- _: 1
217
- })]),
218
- _: 1
219
- }, 8, ["model-value"])], 2)) : (O(), h("div", {
220
- key: 1,
221
- ref_key: "containerRef",
222
- ref: b,
223
- role: V.value ? "tablist" : "group",
224
- "aria-label": l.ariaLabel,
225
- "aria-orientation": V.value ? F.value ? "vertical" : "horizontal" : void 0,
226
- "data-motion": N(d).dataMotion.value,
227
- style: w(N(d).hostStyle.value),
228
- class: C(N(e)("segmented-tabs", `segmented-tabs--${t.variant}`, F.value && "segmented-tabs--vertical", !D.value && "glass-capsule-track", l.class)),
229
- onKeydown: r[0] ||= (...e) => N(Z) && N(Z)(...e)
230
- }, [g("div", {
231
- ref_key: "indicatorRef",
232
- ref: S,
233
- "aria-hidden": "true",
234
- class: C([
235
- "segmented-indicator",
236
- "segmented-indicator--js",
237
- D.value ? "paper-ink-mark" : "glass-capsule",
238
- N($) && "glass-drag-grabbable",
239
- N($) && N(te).dragging.value && "glass-drag-lift"
240
- ]),
241
- style: w(N(ee))
242
- }, null, 6), (O(!0), h(f, null, A(N(G), (e, t) => (O(), h("button", x({
243
- key: e.value,
244
- type: "button",
245
- ref_for: !0,
246
- ref: (e) => {
247
- e && (T.value[t] = e);
248
- },
249
- class: "segmented-tab",
250
- role: V.value ? "tab" : void 0,
251
- tabindex: N(X)(t)
252
- }, { ref_for: !0 }, {
253
- ...Q(e.value) ? { "data-active": "" } : {},
254
- ...V.value ? {
255
- "aria-selected": Q(e.value) ? "true" : "false",
256
- "aria-controls": e.controls || void 0
257
- } : { "aria-pressed": Q(e.value) ? "true" : "false" }
258
- }, {
259
- disabled: e.disabled,
260
- class: [e.disabled && "is-disabled", H(e)],
261
- onClick: (n) => N(Y)(e.value, t)
262
- }), [j(n.$slots, "option", {
263
- option: e,
264
- active: Q(e.value)
265
- }, () => [_(M(e.label), 1)])], 16, B))), 128))], 46, z));
266
- }
267
- });
268
- //#endregion
269
- export { V as t };