@vite-hub/ui 0.4.1 → 0.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/README.md +102 -76
- package/dist/announce-Cy_Tn9wW.js +32 -0
- package/dist/{avatar-stack-DPRFuezh.d.ts → avatar-stack-DXmCQhxd.d.ts} +1 -1
- package/dist/{comment-composer-jYv2ULNP.js → comment-composer-D7ZytyER.js} +257 -10
- package/dist/{comment-composer-fINL5bxo.d.ts → comment-composer-DvKMTrAi.d.ts} +4 -4
- package/dist/{comment-layer-C_sbPIR5.d.ts → comment-layer-GTsLdABl.d.ts} +4 -4
- package/dist/{comment-list-BcSaLngS.d.ts → comment-list-BI96empx.d.ts} +2 -2
- package/dist/comment-marks.css +18 -22
- package/dist/{comment-panel-CfvdRUMX.d.ts → comment-panel-CsKWTms_.d.ts} +2 -2
- package/dist/{comment-pin-DHOdRvUw.d.ts → comment-pin-CvwgRSDR.d.ts} +1 -1
- package/dist/{comment-row-Bn3nr8l5.js → comment-row-JmTC0uXr.js} +1 -1
- package/dist/comment-send-7bg4NEEM.js +277 -0
- package/dist/comment-send-C45dHC22.d.ts +25 -0
- package/dist/comment-send.css +267 -0
- package/dist/comment-thread-B_Sc2QX6.js +797 -0
- package/dist/{comment-thread-DKJjmWN0.d.ts → comment-thread-C6U-bsK_.d.ts} +4 -4
- package/dist/{comments-D0d26ghV.js → comments-B88zg9gC.js} +1 -1
- package/dist/{comments-context-C2lOZyQ5.js → comments-context-DhbIdYQ1.js} +2 -1
- package/dist/{config-Dk67emQt.js → config-B1u7zqMB.js} +8 -1
- package/dist/{config-DgxBW013.d.ts → config-pHazYdq6.d.ts} +11 -0
- package/dist/drop-field-3CDRFFRm.js +163 -0
- package/dist/{editor-C_wt4RRV.js → editor-BHYGLgty.js} +42 -3
- package/dist/effects-Ql6VzCRa.js +2971 -0
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/hold-to-delete-DjWzRDyY.d.ts +51 -0
- package/dist/hold-to-delete-ROLQRZg_.js +434 -0
- package/dist/icon-c5Jb_Tl7.d.ts +31 -0
- package/dist/{image-preview-C9tdkmEj.js → image-preview-BigoAvb3.js} +2 -2
- package/dist/{index-BYRFQfCd.d.ts → index-YUvL2nV8.d.ts} +8 -10
- package/dist/index.d.ts +19 -14
- package/dist/index.js +45 -44
- package/dist/install-D5f6msEU.js +17 -0
- package/dist/list-RCbNZ14q.js +271 -0
- package/dist/{markdown-editor-CMbNZOdN.js → markdown-editor-Dfl2DgPS.js} +1 -1
- package/dist/markdown-editor.js +1 -1
- package/dist/{message-scroller-jrYN9dG9.d.ts → message-scroller-Bm1YWTeY.d.ts} +2 -2
- package/dist/motion/core.d.ts +4 -0
- package/dist/motion/core.js +11 -0
- package/dist/motion-core-lHRF8PZz.d.ts +456 -0
- package/dist/motion.d.ts +16 -0
- package/dist/motion.js +13 -0
- package/dist/{nuxt-ui-DSQFzq3s.js → nuxt-ui-CgvMzO5v.js} +20 -14
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +12 -3
- package/dist/opt-out-b6bnUjIT.js +208 -0
- package/dist/parts/components/agent-session.js +1 -1
- package/dist/parts/components/attachment.d.ts +1 -1
- package/dist/parts/components/attachment.js +1 -1
- package/dist/parts/components/avatar-stack.d.ts +1 -1
- package/dist/parts/components/avatar-stack.js +2 -1
- package/dist/parts/components/bubble.d.ts +1 -1
- package/dist/parts/components/chat-session.d.ts +1 -1
- package/dist/parts/components/chat.js +2 -2
- package/dist/parts/components/code-block.d.ts +1 -1
- package/dist/parts/components/code-block.js +1 -1
- package/dist/parts/components/comment-composer.d.ts +1 -1
- package/dist/parts/components/comment-composer.js +1 -1
- package/dist/parts/components/comment-layer.d.ts +1 -1
- package/dist/parts/components/comment-layer.js +24 -6
- package/dist/parts/components/comment-list.d.ts +1 -1
- package/dist/parts/components/comment-list.js +12 -7
- package/dist/parts/components/comment-panel.d.ts +1 -1
- package/dist/parts/components/comment-panel.js +24 -10
- package/dist/parts/components/comment-pin.d.ts +1 -1
- package/dist/parts/components/comment-selection-bar.js +3 -2
- package/dist/parts/components/comment-send.d.ts +2 -0
- package/dist/parts/components/comment-send.js +2 -0
- package/dist/parts/components/comment-thread.d.ts +1 -1
- package/dist/parts/components/comment-thread.js +2 -597
- package/dist/parts/components/comments.d.ts +8 -7
- package/dist/parts/components/comments.js +5 -4
- package/dist/parts/components/copy-button.d.ts +13 -3
- package/dist/parts/components/copy-button.js +226 -1
- package/dist/parts/components/device-frame.d.ts +2 -2
- package/dist/parts/components/drop-field.d.ts +69 -0
- package/dist/parts/components/drop-field.js +77 -0
- package/dist/parts/components/filter-search.js +1 -1
- package/dist/parts/components/hold-to-delete.d.ts +82 -0
- package/dist/parts/components/hold-to-delete.js +76 -0
- package/dist/parts/components/markdown-editor.js +1 -1
- package/dist/parts/components/markdown-renderer.js +1 -1
- package/dist/parts/components/markdown.js +1 -1
- package/dist/parts/components/marker.d.ts +1 -1
- package/dist/parts/components/message-parts.js +13 -5
- package/dist/parts/components/motion-list.d.ts +42 -0
- package/dist/parts/components/motion-list.js +42 -0
- package/dist/parts/components/motion.d.ts +124 -0
- package/dist/parts/components/motion.js +172 -0
- package/dist/parts/components/progress.d.ts +41 -0
- package/dist/parts/components/progress.js +54 -0
- package/dist/parts/components/prompt-input.d.ts +5 -5
- package/dist/parts/components/prompt-input.js +3 -3
- package/dist/parts/components/relative-time.js +1 -1
- package/dist/parts/components/sync-status.js +2 -1
- package/dist/parts/components/tool-list.d.ts +1 -1
- package/dist/parts/components/trace-run.d.ts +1 -1
- package/dist/parts/components/trace-run.js +1 -1
- package/dist/parts/components/trace.d.ts +1 -1
- package/dist/parts/headless/comments.js +1 -1
- package/dist/parts/headless/message-scroller.d.ts +1 -1
- package/dist/parts/playground/share.d.ts +36 -2
- package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
- package/dist/parts/workspace/browser-support-notice.js +12 -4
- package/dist/parts/workspace/codemirror.d.ts +9 -0
- package/dist/parts/workspace/codemirror.js +37 -4
- package/dist/parts/workspace/connect-panel.d.ts +1 -1
- package/dist/parts/workspace/connect-panel.js +1 -1
- package/dist/parts/workspace/file-icons.d.ts +16 -0
- package/dist/parts/workspace/file-icons.js +82 -0
- package/dist/parts/workspace/icons.d.ts +1 -0
- package/dist/parts/workspace/icons.js +1 -0
- package/dist/parts/workspace/runners/render.d.ts +26 -0
- package/dist/parts/workspace/runners/render.js +124 -0
- package/dist/parts/workspace/runners/web-container.d.ts +29 -0
- package/dist/parts/workspace/runners/web-container.js +186 -0
- package/dist/parts/workspace/workspace-bar.d.ts +51 -0
- package/dist/parts/workspace/workspace-bar.js +51 -0
- package/dist/parts/workspace/workspace-editor-head.d.ts +47 -0
- package/dist/parts/workspace/workspace-editor-head.js +66 -0
- package/dist/parts/workspace/workspace-editor.d.ts +17 -0
- package/dist/parts/workspace/workspace-editor.js +29 -3
- package/dist/parts/workspace/workspace-examples.d.ts +74 -0
- package/dist/parts/workspace/workspace-examples.js +72 -0
- package/dist/parts/workspace/workspace-file-link.d.ts +35 -0
- package/dist/parts/workspace/workspace-file-link.js +39 -0
- package/dist/parts/workspace/workspace-file-tree.d.ts +8 -8
- package/dist/parts/workspace/workspace-file-tree.js +26 -19
- package/dist/parts/workspace/workspace-guide.d.ts +52 -0
- package/dist/parts/workspace/workspace-guide.js +91 -0
- package/dist/parts/workspace/workspace-issues.d.ts +46 -0
- package/dist/parts/workspace/workspace-issues.js +49 -0
- package/dist/parts/workspace/workspace-preview.js +1 -1
- package/dist/parts/workspace/workspace-shell.d.ts +2 -88
- package/dist/parts/workspace/workspace-shell.js +131 -78
- package/dist/parts/workspace/workspace-sidebar.d.ts +75 -0
- package/dist/parts/workspace/workspace-sidebar.js +132 -0
- package/dist/parts/workspace/workspace-start.d.ts +47 -0
- package/dist/parts/workspace/workspace-start.js +60 -0
- package/dist/parts/workspace/workspace-status.d.ts +69 -0
- package/dist/parts/workspace/workspace-status.js +74 -0
- package/dist/parts/workspace/workspace-steps.d.ts +2 -0
- package/dist/parts/workspace/workspace-steps.js +128 -0
- package/dist/parts/workspace/workspace-task.d.ts +20 -0
- package/dist/parts/workspace/workspace-task.js +20 -0
- package/dist/parts/workspace/workspace.d.ts +251 -0
- package/dist/parts/workspace/workspace.js +665 -0
- package/dist/playground.d.ts +1 -1
- package/dist/progress-C7afI5vq.js +266 -0
- package/dist/registry-D3-ysX7l.js +78 -0
- package/dist/{relative-time-BVmjOsYG.js → relative-time-DgSS3zKN.js} +1 -1
- package/dist/ring-B7Qxu7zd.js +175 -0
- package/dist/runtime/nuxt-plugin.js +2 -2
- package/dist/styles.css +586 -573
- package/dist/text-BCJflBJf.js +826 -0
- package/dist/theme.d.ts +43 -0
- package/dist/theme.js +22 -7
- package/dist/travel-C87xd5Wh.js +182 -0
- package/dist/tween-CO24nMpf.js +62 -0
- package/dist/{types-Dj7vp0lZ.d.ts → types-BX64qHlV.d.ts} +1 -1
- package/dist/visual-copy-CrVc3z4n.js +15 -0
- package/dist/workspace-shell-BJGnoF3p.d.ts +112 -0
- package/dist/workspace-steps-Bgph2rpr.d.ts +72 -0
- package/dist/workspace.d.ts +16 -3
- package/dist/workspace.js +15 -2
- package/package.json +21 -10
- package/dist/copy-button-CRN3kmSD.js +0 -253
- package/dist/icon-swap.css +0 -69
- package/dist/parts/playground/highlight.d.ts +0 -5
- package/dist/parts/playground/highlight.js +0 -23
- package/dist/parts/playground/playground-render.d.ts +0 -126
- package/dist/parts/playground/playground-render.js +0 -356
- package/dist/parts/workspace/playground-container.d.ts +0 -192
- package/dist/parts/workspace/playground-container.js +0 -603
- package/dist/share-DM4eNy4q.d.ts +0 -37
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { a as onEachFrame, r as createSpring, s as springs, t as isMotionOff, u as prefersReducedMotion } from "./opt-out-b6bnUjIT.js";
|
|
2
|
+
import { i as playTween, r as easeOut, t as cubicBezier } from "./tween-CO24nMpf.js";
|
|
3
|
+
//#region src/motion/progress.ts
|
|
4
|
+
const svgNs = "http://www.w3.org/2000/svg";
|
|
5
|
+
const height = 8;
|
|
6
|
+
const rail = 2;
|
|
7
|
+
const bar = 4;
|
|
8
|
+
const bulge = 4;
|
|
9
|
+
const headWidth = 10;
|
|
10
|
+
const waveWidth = 36;
|
|
11
|
+
const waveSpeed = 260;
|
|
12
|
+
const settleRate = 3;
|
|
13
|
+
const tickEasing = cubicBezier(.6, 0, .2, 1);
|
|
14
|
+
const tickPath = "M5 12.5l4.5 4.5L19 7.5";
|
|
15
|
+
function svg(tag, attributes) {
|
|
16
|
+
const element = document.createElementNS(svgNs, tag);
|
|
17
|
+
for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value);
|
|
18
|
+
return element;
|
|
19
|
+
}
|
|
20
|
+
function line(x0, x1, thickness) {
|
|
21
|
+
const y = height / 2;
|
|
22
|
+
const top = [];
|
|
23
|
+
const bottom = [];
|
|
24
|
+
for (let x = x0; x <= x1 + .01; x += 1.5) {
|
|
25
|
+
const half = thickness(Math.min(x, x1)) / 2;
|
|
26
|
+
top.push(`${Math.min(x, x1).toFixed(2)} ${(y - half).toFixed(2)}`);
|
|
27
|
+
bottom.unshift(`${Math.min(x, x1).toFixed(2)} ${(y + half).toFixed(2)}`);
|
|
28
|
+
}
|
|
29
|
+
if (!top.length) return "";
|
|
30
|
+
const end = thickness(x1) / 2;
|
|
31
|
+
const start = thickness(x0) / 2;
|
|
32
|
+
return `M${top.join("L")}A${end.toFixed(2)} ${end.toFixed(2)} 0 0 1 ${bottom[0]}L${bottom.join("L")}A${start.toFixed(2)} ${start.toFixed(2)} 0 0 1 ${top[0]}Z`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The progress helper of docs/design/motion.md: "Work runs". It draws into `host`: a bar with a head while it fills, a
|
|
36
|
+
* wave while it processes with no known total, and a dot that draws into a check when the work is done.
|
|
37
|
+
*
|
|
38
|
+
* The host gets `role="progressbar"` with `aria-valuenow` from 0 to 100, no `aria-valuenow` during the wave, and
|
|
39
|
+
* `data-phase`. The bar uses `currentColor`, and the rail `--vh-progress-rail` or the Nuxt UI accented border color.
|
|
40
|
+
* Under reduced motion the bar jumps to its value, there is no head or wave, and the check cross-fades in 150ms. Inside
|
|
41
|
+
* `data-motion="none"` the bar jumps and the check shows at once.
|
|
42
|
+
*/
|
|
43
|
+
function createProgress(host, options = {}) {
|
|
44
|
+
const chart = svg("svg", {
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
"data-part": "bar",
|
|
47
|
+
height: String(height),
|
|
48
|
+
preserveAspectRatio: "none"
|
|
49
|
+
});
|
|
50
|
+
const railPath = svg("path", {
|
|
51
|
+
"data-part": "rail",
|
|
52
|
+
fill: "var(--vh-progress-rail, var(--ui-border-accented, color-mix(in oklch, currentColor 20%, transparent)))"
|
|
53
|
+
});
|
|
54
|
+
const fillPath = svg("path", {
|
|
55
|
+
"data-part": "fill",
|
|
56
|
+
fill: "currentColor"
|
|
57
|
+
});
|
|
58
|
+
chart.append(railPath, fillPath);
|
|
59
|
+
const check = svg("svg", {
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
"data-part": "check",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
"stroke-linecap": "round",
|
|
65
|
+
"stroke-linejoin": "round",
|
|
66
|
+
"stroke-width": "2",
|
|
67
|
+
viewBox: "0 0 24 24"
|
|
68
|
+
});
|
|
69
|
+
const dot = svg("circle", {
|
|
70
|
+
cx: "12",
|
|
71
|
+
cy: "12",
|
|
72
|
+
fill: "currentColor",
|
|
73
|
+
r: "0",
|
|
74
|
+
stroke: "none"
|
|
75
|
+
});
|
|
76
|
+
const tick = svg("path", {
|
|
77
|
+
d: tickPath,
|
|
78
|
+
pathLength: "1",
|
|
79
|
+
"stroke-dasharray": "1",
|
|
80
|
+
"stroke-dashoffset": "1"
|
|
81
|
+
});
|
|
82
|
+
check.append(dot, tick);
|
|
83
|
+
Object.assign(chart.style, {
|
|
84
|
+
display: "block",
|
|
85
|
+
flex: "1 1 auto",
|
|
86
|
+
minWidth: "0",
|
|
87
|
+
overflow: "visible",
|
|
88
|
+
width: "100%"
|
|
89
|
+
});
|
|
90
|
+
Object.assign(check.style, {
|
|
91
|
+
flex: "none",
|
|
92
|
+
height: "18px",
|
|
93
|
+
width: "18px"
|
|
94
|
+
});
|
|
95
|
+
if (!host.style.display) Object.assign(host.style, {
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
display: "flex",
|
|
98
|
+
gap: "8px"
|
|
99
|
+
});
|
|
100
|
+
host.append(chart, check);
|
|
101
|
+
host.setAttribute("role", "progressbar");
|
|
102
|
+
host.setAttribute("aria-valuemin", "0");
|
|
103
|
+
host.setAttribute("aria-valuemax", "100");
|
|
104
|
+
if (options.label && !host.hasAttribute("aria-label")) host.setAttribute("aria-label", options.label);
|
|
105
|
+
let phase = "idle";
|
|
106
|
+
let width = chart.clientWidth;
|
|
107
|
+
let wave = -40;
|
|
108
|
+
let flat = 0;
|
|
109
|
+
let stopWave;
|
|
110
|
+
let stopTimeline = [];
|
|
111
|
+
const still = () => prefersReducedMotion() || isMotionOff(host);
|
|
112
|
+
const end = createSpring(0, () => draw(), springs.snappy);
|
|
113
|
+
function draw() {
|
|
114
|
+
width = chart.clientWidth || width;
|
|
115
|
+
chart.setAttribute("viewBox", `0 0 ${Math.max(1, width)} ${height}`);
|
|
116
|
+
const x0 = 2;
|
|
117
|
+
const x1 = Math.max(x0, width - 2);
|
|
118
|
+
railPath.setAttribute("d", line(x0, x1, () => rail));
|
|
119
|
+
const shape = still() ? 0 : 1 - flat;
|
|
120
|
+
if (phase === "wave" || phase === "done" && flat < 1 && stopWave) {
|
|
121
|
+
fillPath.setAttribute("d", line(x0, x1, (x) => bar + bulge * shape * Math.exp(-(((x - wave) / waveWidth) ** 2))));
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const head = x0 + (x1 - x0) * Math.max(0, Math.min(1, end.value));
|
|
125
|
+
fillPath.setAttribute("d", phase === "idle" ? "" : line(x0, Math.max(x0, head), (x) => bar + bulge * shape * Math.exp(-(((x - head + headWidth) / headWidth) ** 2))));
|
|
126
|
+
}
|
|
127
|
+
function setPhase(next) {
|
|
128
|
+
phase = next;
|
|
129
|
+
host.dataset.phase = next;
|
|
130
|
+
host.setAttribute("aria-busy", String(next === "fill" || next === "wave"));
|
|
131
|
+
}
|
|
132
|
+
function stopAll() {
|
|
133
|
+
stopWave?.();
|
|
134
|
+
stopWave = void 0;
|
|
135
|
+
for (const stop of stopTimeline) stop();
|
|
136
|
+
stopTimeline = [];
|
|
137
|
+
}
|
|
138
|
+
function startWave() {
|
|
139
|
+
if (stopWave || still()) return;
|
|
140
|
+
wave = -40;
|
|
141
|
+
stopWave = onEachFrame((seconds) => {
|
|
142
|
+
if (phase === "done") {
|
|
143
|
+
flat = Math.min(1, flat + seconds * settleRate);
|
|
144
|
+
wave += waveSpeed * seconds;
|
|
145
|
+
draw();
|
|
146
|
+
if (flat < 1) return true;
|
|
147
|
+
end.set(1);
|
|
148
|
+
stopWave = void 0;
|
|
149
|
+
draw();
|
|
150
|
+
drawCheck();
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
wave = -40 + (wave + 40 + waveSpeed * seconds) % (width + 80);
|
|
154
|
+
draw();
|
|
155
|
+
return true;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function clearCheck() {
|
|
159
|
+
dot.setAttribute("r", "0");
|
|
160
|
+
tick.setAttribute("stroke-dashoffset", "1");
|
|
161
|
+
check.style.opacity = "";
|
|
162
|
+
}
|
|
163
|
+
function drawCheck() {
|
|
164
|
+
if (isMotionOff(host)) {
|
|
165
|
+
tick.setAttribute("stroke-dashoffset", "0");
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (prefersReducedMotion()) {
|
|
169
|
+
check.style.opacity = "0";
|
|
170
|
+
tick.setAttribute("stroke-dashoffset", "0");
|
|
171
|
+
const fade = playTween(.15, (p) => check.style.opacity = p.toFixed(3));
|
|
172
|
+
stopTimeline.push(fade.stop);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const grow = playTween(.32, (p) => {
|
|
176
|
+
dot.setAttribute("r", (p <= .5 ? 7 * p : 3.5 - 3 * (p - .5)).toFixed(3));
|
|
177
|
+
}, easeOut);
|
|
178
|
+
stopTimeline.push(grow.stop);
|
|
179
|
+
grow.done.then((completed) => {
|
|
180
|
+
if (!completed) return;
|
|
181
|
+
const shrink = playTween(.12, (p) => dot.setAttribute("r", (2 - 2 * p).toFixed(3)));
|
|
182
|
+
const draw = playTween(.32, (p) => tick.setAttribute("stroke-dashoffset", (1 - p).toFixed(4)), tickEasing);
|
|
183
|
+
stopTimeline.push(shrink.stop, draw.stop);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function settleFill() {
|
|
187
|
+
if (still()) {
|
|
188
|
+
flat = 1;
|
|
189
|
+
draw();
|
|
190
|
+
drawCheck();
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const wait = onEachFrame(() => {
|
|
194
|
+
if (end.active) return true;
|
|
195
|
+
const flatten = playTween(1 / settleRate, (p) => {
|
|
196
|
+
flat = p;
|
|
197
|
+
draw();
|
|
198
|
+
});
|
|
199
|
+
stopTimeline.push(flatten.stop);
|
|
200
|
+
flatten.done.then((completed) => completed && drawCheck());
|
|
201
|
+
return false;
|
|
202
|
+
});
|
|
203
|
+
stopTimeline.push(wait);
|
|
204
|
+
}
|
|
205
|
+
const resize = typeof ResizeObserver === "function" ? new ResizeObserver(() => draw()) : void 0;
|
|
206
|
+
resize?.observe(chart);
|
|
207
|
+
setPhase("idle");
|
|
208
|
+
draw();
|
|
209
|
+
return {
|
|
210
|
+
get phase() {
|
|
211
|
+
return phase;
|
|
212
|
+
},
|
|
213
|
+
set(value) {
|
|
214
|
+
if (phase === "done") {
|
|
215
|
+
stopAll();
|
|
216
|
+
clearCheck();
|
|
217
|
+
flat = 0;
|
|
218
|
+
}
|
|
219
|
+
if (value === null) {
|
|
220
|
+
host.removeAttribute("aria-valuenow");
|
|
221
|
+
setPhase("wave");
|
|
222
|
+
startWave();
|
|
223
|
+
draw();
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const fraction = Math.max(0, Math.min(1, value));
|
|
227
|
+
host.setAttribute("aria-valuenow", String(Math.round(fraction * 100)));
|
|
228
|
+
if (phase === "wave") {
|
|
229
|
+
stopWave?.();
|
|
230
|
+
stopWave = void 0;
|
|
231
|
+
}
|
|
232
|
+
if (phase !== "fill") setPhase("fill");
|
|
233
|
+
if (still()) end.set(fraction);
|
|
234
|
+
else end.to(fraction);
|
|
235
|
+
},
|
|
236
|
+
done() {
|
|
237
|
+
if (phase === "done") return;
|
|
238
|
+
host.setAttribute("aria-valuenow", "100");
|
|
239
|
+
const fromWave = phase === "wave" && stopWave !== void 0;
|
|
240
|
+
setPhase("done");
|
|
241
|
+
flat = 0;
|
|
242
|
+
if (fromWave) return;
|
|
243
|
+
if (still()) end.set(1);
|
|
244
|
+
else end.to(1);
|
|
245
|
+
settleFill();
|
|
246
|
+
},
|
|
247
|
+
reset() {
|
|
248
|
+
stopAll();
|
|
249
|
+
clearCheck();
|
|
250
|
+
flat = 0;
|
|
251
|
+
end.set(0);
|
|
252
|
+
host.setAttribute("aria-valuenow", "0");
|
|
253
|
+
setPhase("idle");
|
|
254
|
+
draw();
|
|
255
|
+
},
|
|
256
|
+
destroy() {
|
|
257
|
+
stopAll();
|
|
258
|
+
end.stop();
|
|
259
|
+
resize?.disconnect();
|
|
260
|
+
chart.remove();
|
|
261
|
+
check.remove();
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
export { createProgress as t };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { u as prefersReducedMotion } from "./opt-out-b6bnUjIT.js";
|
|
2
|
+
//#region src/motion/registry.ts
|
|
3
|
+
/** The attributes whose change the motion layer reports to the `state` hook of an effect. */
|
|
4
|
+
const motionStateAttributes = [
|
|
5
|
+
"aria-checked",
|
|
6
|
+
"aria-selected",
|
|
7
|
+
"aria-pressed",
|
|
8
|
+
"aria-expanded",
|
|
9
|
+
"aria-valuenow",
|
|
10
|
+
"aria-valuetext",
|
|
11
|
+
"data-state",
|
|
12
|
+
"data-checked",
|
|
13
|
+
"data-open",
|
|
14
|
+
"open",
|
|
15
|
+
"data-leaving"
|
|
16
|
+
];
|
|
17
|
+
const effects = /* @__PURE__ */ new Map();
|
|
18
|
+
const changeListeners = /* @__PURE__ */ new Set();
|
|
19
|
+
const sharedKey = Symbol.for("vite-hub.motion.layer");
|
|
20
|
+
let ownLayer;
|
|
21
|
+
/** The shared layer of another copy of this module, when that copy installed first. */
|
|
22
|
+
function otherMotionLayer() {
|
|
23
|
+
const shared = Reflect.get(globalThis, sharedKey);
|
|
24
|
+
if (!shared || shared === ownLayer || typeof shared !== "object" || !("define" in shared) || !("install" in shared)) return void 0;
|
|
25
|
+
return shared;
|
|
26
|
+
}
|
|
27
|
+
/** Makes this copy the shared layer when no copy is yet. */
|
|
28
|
+
function claimMotionLayer(layer) {
|
|
29
|
+
ownLayer = layer;
|
|
30
|
+
if (!Reflect.get(globalThis, sharedKey)) Reflect.set(globalThis, sharedKey, layer);
|
|
31
|
+
}
|
|
32
|
+
function handOffMotionEffects(shared) {
|
|
33
|
+
const registrations = [...effects.values()];
|
|
34
|
+
effects.clear();
|
|
35
|
+
for (const registration of registrations) registration.removeFromShared = shared.define(registration.effect, registration.isReduced);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Adds an effect to the motion layer. Every installed layer runs it from the next interaction on. Returns a function
|
|
39
|
+
* that removes it. When another copy of the module is the shared layer, the effect goes to that copy.
|
|
40
|
+
*/
|
|
41
|
+
function defineMotionEffect(effect) {
|
|
42
|
+
const shared = otherMotionLayer();
|
|
43
|
+
if (!shared) return defineOwnEffect(effect);
|
|
44
|
+
handOffMotionEffects(shared);
|
|
45
|
+
return shared.define(effect, prefersReducedMotion);
|
|
46
|
+
}
|
|
47
|
+
function defineOwnEffect(effect, isReduced = prefersReducedMotion) {
|
|
48
|
+
const registration = {
|
|
49
|
+
effect,
|
|
50
|
+
isReduced
|
|
51
|
+
};
|
|
52
|
+
effects.set(effect.name, registration);
|
|
53
|
+
for (const listener of changeListeners) listener();
|
|
54
|
+
return () => {
|
|
55
|
+
if (registration.removeFromShared) return registration.removeFromShared();
|
|
56
|
+
if (effects.get(effect.name) !== registration) return;
|
|
57
|
+
effects.delete(effect.name);
|
|
58
|
+
for (const listener of changeListeners) listener();
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** The effects of the motion layer, in the order they were defined. */
|
|
62
|
+
function listMotionEffects() {
|
|
63
|
+
return [...effects.values()].map((registration) => registration.effect);
|
|
64
|
+
}
|
|
65
|
+
function motionEffectRegistrations() {
|
|
66
|
+
return [...effects.values()];
|
|
67
|
+
}
|
|
68
|
+
function onMotionEffectsChange(listener) {
|
|
69
|
+
changeListeners.add(listener);
|
|
70
|
+
return () => changeListeners.delete(listener);
|
|
71
|
+
}
|
|
72
|
+
/** Writes motion properties inline. An empty string or `null` removes the property, so the stylesheet applies again. */
|
|
73
|
+
function writeMotionStyle(element, values) {
|
|
74
|
+
for (const [property, value] of Object.entries(values)) if (value) element.style.setProperty(property, value);
|
|
75
|
+
else element.style.removeProperty(property);
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { listMotionEffects as a, onMotionEffectsChange as c, handOffMotionEffects as i, otherMotionLayer as l, defineMotionEffect as n, motionEffectRegistrations as o, defineOwnEffect as r, motionStateAttributes as s, claimMotionLayer as t, writeMotionStyle as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useTooltipComponent } from "./nuxt-ui-
|
|
1
|
+
import { n as useTooltipComponent } from "./nuxt-ui-CgvMzO5v.js";
|
|
2
2
|
import { t as uiErrorDiagnostics } from "./error-diagnostics-SXtnk6bz.js";
|
|
3
3
|
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, provide, ref, shallowRef } from "vue";
|
|
4
4
|
//#region src/internal/describe-time.ts
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { r as createSpring, t as isMotionOff, u as prefersReducedMotion } from "./opt-out-b6bnUjIT.js";
|
|
2
|
+
import { a as tween, r as easeOut } from "./tween-CO24nMpf.js";
|
|
3
|
+
//#region src/motion/helpers/frame.ts
|
|
4
|
+
const ownNodes = /* @__PURE__ */ new WeakSet();
|
|
5
|
+
function own(node) {
|
|
6
|
+
ownNodes.add(node);
|
|
7
|
+
return node;
|
|
8
|
+
}
|
|
9
|
+
function isOwnNode(node) {
|
|
10
|
+
return ownNodes.has(node);
|
|
11
|
+
}
|
|
12
|
+
const glyphRule = "[data-motion-glyph]::before{content:attr(data-motion-glyph)}";
|
|
13
|
+
const glyphStyles = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
function hasGlyphRule(element) {
|
|
15
|
+
const root = element.getRootNode();
|
|
16
|
+
const target = root instanceof ShadowRoot ? root : element.ownerDocument.head;
|
|
17
|
+
if (!target) return false;
|
|
18
|
+
const existing = glyphStyles.get(root);
|
|
19
|
+
if (existing?.parentNode === target) return !!existing.sheet;
|
|
20
|
+
const style = own(element.ownerDocument.createElement("style"));
|
|
21
|
+
style.dataset.motionGlyphs = "";
|
|
22
|
+
style.textContent = glyphRule;
|
|
23
|
+
target.append(style);
|
|
24
|
+
glyphStyles.set(root, style);
|
|
25
|
+
return !!style.sheet;
|
|
26
|
+
}
|
|
27
|
+
/** A span that draws one character, or a run of them, without adding to `textContent`. */
|
|
28
|
+
function glyphNode(text) {
|
|
29
|
+
const node = own(document.createElement("span"));
|
|
30
|
+
node.dataset.motionGlyph = text;
|
|
31
|
+
node.style.whiteSpace = "pre";
|
|
32
|
+
return node;
|
|
33
|
+
}
|
|
34
|
+
/** True when the helpers must set the change at once: no layout, or `data-motion="none"`. */
|
|
35
|
+
function motionSkipped(element) {
|
|
36
|
+
return !element.isConnected || typeof requestAnimationFrame !== "function" || isMotionOff(element);
|
|
37
|
+
}
|
|
38
|
+
function glyphMotionSkipped(element) {
|
|
39
|
+
return motionSkipped(element) || !element.getClientRects().length || !hasGlyphRule(element);
|
|
40
|
+
}
|
|
41
|
+
function reduced() {
|
|
42
|
+
return prefersReducedMotion();
|
|
43
|
+
}
|
|
44
|
+
const widthSpring = {
|
|
45
|
+
stiffness: 380,
|
|
46
|
+
damping: 34
|
|
47
|
+
};
|
|
48
|
+
const framed = [
|
|
49
|
+
"display",
|
|
50
|
+
"position",
|
|
51
|
+
"width",
|
|
52
|
+
"white-space",
|
|
53
|
+
"box-sizing",
|
|
54
|
+
"overflow",
|
|
55
|
+
"justify-content",
|
|
56
|
+
"vertical-align"
|
|
57
|
+
];
|
|
58
|
+
const frames = /* @__PURE__ */ new WeakMap();
|
|
59
|
+
function frameOf(element) {
|
|
60
|
+
return frames.get(element);
|
|
61
|
+
}
|
|
62
|
+
/** Starts a frame on the element. `layout` sets how the letters sit while they move. */
|
|
63
|
+
function openFrame(element, layout, onWidthSettle) {
|
|
64
|
+
const saved = framed.map((property) => [
|
|
65
|
+
property,
|
|
66
|
+
element.style.getPropertyValue(property),
|
|
67
|
+
element.style.getPropertyPriority(property)
|
|
68
|
+
]);
|
|
69
|
+
const computed = getComputedStyle(element);
|
|
70
|
+
if (layout === "end") {
|
|
71
|
+
element.style.display = computed.display.startsWith("inline") || computed.display === "contents" ? "inline-flex" : "flex";
|
|
72
|
+
element.style.justifyContent = "flex-end";
|
|
73
|
+
} else if (computed.display === "inline" || computed.display === "contents") element.style.display = "inline-block";
|
|
74
|
+
if (computed.position === "static") element.style.position = "relative";
|
|
75
|
+
element.style.whiteSpace = "nowrap";
|
|
76
|
+
element.style.boxSizing = "border-box";
|
|
77
|
+
element.style.overflow = "visible";
|
|
78
|
+
const copy = own(document.createElement("span"));
|
|
79
|
+
copy.dataset.motionCopy = "";
|
|
80
|
+
copy.style.cssText = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0";
|
|
81
|
+
const holder = own(document.createElement("span"));
|
|
82
|
+
holder.setAttribute("aria-hidden", "true");
|
|
83
|
+
holder.dataset.motionGlyphs = "";
|
|
84
|
+
holder.style.display = "contents";
|
|
85
|
+
element.replaceChildren(copy, holder);
|
|
86
|
+
const width = createSpring(0, (value, velocity) => {
|
|
87
|
+
element.style.width = `${value}px`;
|
|
88
|
+
if (velocity === 0 && value === width.target) onWidthSettle();
|
|
89
|
+
}, widthSpring);
|
|
90
|
+
const frame = {
|
|
91
|
+
element,
|
|
92
|
+
holder,
|
|
93
|
+
width,
|
|
94
|
+
name(text) {
|
|
95
|
+
copy.textContent = text;
|
|
96
|
+
},
|
|
97
|
+
restore() {
|
|
98
|
+
if (holder.parentNode !== element || copy.parentNode !== element) element.replaceChildren(copy, holder);
|
|
99
|
+
},
|
|
100
|
+
natural() {
|
|
101
|
+
const current = element.style.width;
|
|
102
|
+
element.style.width = "max-content";
|
|
103
|
+
const style = getComputedStyle(element);
|
|
104
|
+
const computedWidth = Number.parseFloat(style.width);
|
|
105
|
+
const value = Number.isFinite(computedWidth) ? computedWidth : element.offsetWidth;
|
|
106
|
+
element.style.width = current;
|
|
107
|
+
return value;
|
|
108
|
+
},
|
|
109
|
+
collapse(text) {
|
|
110
|
+
frame.discard();
|
|
111
|
+
element.replaceChildren(own(document.createTextNode(text)));
|
|
112
|
+
},
|
|
113
|
+
discard() {
|
|
114
|
+
width.stop();
|
|
115
|
+
frames.delete(element);
|
|
116
|
+
copy.remove();
|
|
117
|
+
holder.remove();
|
|
118
|
+
for (const [property, value, priority] of saved) if (value) element.style.setProperty(property, value, priority);
|
|
119
|
+
else element.style.removeProperty(property);
|
|
120
|
+
if (!element.getAttribute("style")) element.removeAttribute("style");
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
frames.set(element, frame);
|
|
124
|
+
return frame;
|
|
125
|
+
}
|
|
126
|
+
/** Sets the text of an element that has no frame, or ends its frame, at once. */
|
|
127
|
+
function setText(element, text) {
|
|
128
|
+
const frame = frames.get(element);
|
|
129
|
+
if (frame) frame.collapse(text);
|
|
130
|
+
else if (element.textContent !== text) element.replaceChildren(own(document.createTextNode(text)));
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/motion/helpers/ring.ts
|
|
134
|
+
const duration = 720;
|
|
135
|
+
const peak = .3;
|
|
136
|
+
const color = "var(--ui-border-accented, currentColor)";
|
|
137
|
+
const rings = /* @__PURE__ */ new WeakMap();
|
|
138
|
+
/**
|
|
139
|
+
* Rings `element` once, as rule 7 of docs/design/motion.md asks for a finished action such as saved, published, or
|
|
140
|
+
* copied: a 5px ring in the border color grows around it and fades. A second call starts the ring again. There is no
|
|
141
|
+
* ring under reduced motion or inside `data-motion="none"`.
|
|
142
|
+
*/
|
|
143
|
+
function ring(element) {
|
|
144
|
+
const running = rings.get(element);
|
|
145
|
+
running?.tween.stop();
|
|
146
|
+
const own = running?.own ?? element.style.boxShadow;
|
|
147
|
+
if (motionSkipped(element) || reduced()) {
|
|
148
|
+
if (running) {
|
|
149
|
+
rings.delete(element);
|
|
150
|
+
element.style.boxShadow = own;
|
|
151
|
+
}
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const base = running ? void 0 : getComputedStyle(element).boxShadow;
|
|
155
|
+
const under = running?.under ?? (base && base !== "none" ? `, ${base}` : "");
|
|
156
|
+
const handle = tween(0, 1, {
|
|
157
|
+
duration,
|
|
158
|
+
ease: easeOut
|
|
159
|
+
}, (progress) => {
|
|
160
|
+
const spread = progress < peak ? 5 * (progress / peak) : 5 + 2 * ((progress - peak) / .7);
|
|
161
|
+
const alpha = progress < peak ? 1 : 1 - (progress - peak) / .7;
|
|
162
|
+
element.style.boxShadow = `0 0 0 ${spread.toFixed(2)}px color-mix(in oklab, ${color} ${(alpha * 100).toFixed(1)}%, transparent)${under}`;
|
|
163
|
+
}, () => {
|
|
164
|
+
rings.delete(element);
|
|
165
|
+
element.style.boxShadow = own;
|
|
166
|
+
if (!element.getAttribute("style")) element.removeAttribute("style");
|
|
167
|
+
});
|
|
168
|
+
rings.set(element, {
|
|
169
|
+
tween: handle,
|
|
170
|
+
own,
|
|
171
|
+
under
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
export { isOwnNode as a, own as c, glyphNode as i, reduced as l, frameOf as n, motionSkipped as o, glyphMotionSkipped as r, openFrame as s, ring as t, setText as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as createViteHubUI } from "../config-
|
|
2
|
-
import { n as provideRelativeNow, r as startRelativeClock } from "../relative-time-
|
|
1
|
+
import { n as createViteHubUI } from "../config-B1u7zqMB.js";
|
|
2
|
+
import { n as provideRelativeNow, r as startRelativeClock } from "../relative-time-DgSS3zKN.js";
|
|
3
3
|
import { defineAsyncComponent } from "vue";
|
|
4
4
|
import { defineNuxtPlugin, useAppConfig, useRuntimeConfig, useState } from "#app";
|
|
5
5
|
//#region src/runtime/nuxt-plugin.ts
|