@voltro/devtools 0.1.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/CHANGELOG.md +52 -0
- package/LICENSE +57 -0
- package/README.md +26 -0
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +347 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +1911 -0
- package/dist/styles.css +655 -0
- package/package.json +47 -0
package/dist/styles.css
ADDED
|
@@ -0,0 +1,655 @@
|
|
|
1
|
+
/* @voltro/devtools — CSS isolation strategy.
|
|
2
|
+
*
|
|
3
|
+
* Every Tailwind utility consumed by the devtools UI is generated under
|
|
4
|
+
* the `vdt:` prefix (`vdt:bg-card`, `vdt:flex`, `vdt:rounded-md`, …) so it
|
|
5
|
+
* cannot collide with the host app's utility namespace. The consumer
|
|
6
|
+
* app's `globals.css` adds `@import "@voltro/devtools/styles.css"` and
|
|
7
|
+
* Tailwind v4's vite plugin compiles the devtools tree into the same
|
|
8
|
+
* bundle — but with the prefixed utility set kept entirely separate
|
|
9
|
+
* from the host's unprefixed one.
|
|
10
|
+
*
|
|
11
|
+
* Tokens (--background, --foreground, --border, …) are NOT defined
|
|
12
|
+
* against `:root`. They live under `.vdt-scope` instead, so the host
|
|
13
|
+
* page's token values aren't shadowed by the devtools'. The devtools
|
|
14
|
+
* root element carries `class="vdt-scope vdt:dark"` — every descendant
|
|
15
|
+
* resolves tokens from this layer; the host's tree is untouched.
|
|
16
|
+
*
|
|
17
|
+
* Visual identity: always dark, brand-violet accent. The host page's
|
|
18
|
+
* theme (light / dark / system) has zero influence — devtools is its
|
|
19
|
+
* own surface. */
|
|
20
|
+
|
|
21
|
+
@import "tailwindcss" prefix(vdt);
|
|
22
|
+
|
|
23
|
+
/* Scan the devtools source tree only. The Tailwind v4 vite plugin
|
|
24
|
+
* picks this up because this file is `@import`-ed from the consumer's
|
|
25
|
+
* globals.css; the relative path resolves through the workspace
|
|
26
|
+
* symlink. */
|
|
27
|
+
@source "./**/*.{tsx,ts}";
|
|
28
|
+
|
|
29
|
+
/* ---- Tokens (dark-only, scoped to .vdt-scope) ---- */
|
|
30
|
+
|
|
31
|
+
.vdt-scope {
|
|
32
|
+
--background: oklch(0.155 0.005 285);
|
|
33
|
+
--background-elevated: oklch(0.19 0.006 285);
|
|
34
|
+
--foreground: oklch(0.98 0.005 285);
|
|
35
|
+
--foreground-muted: oklch(0.65 0.012 285);
|
|
36
|
+
--foreground-subtle: oklch(0.5 0.012 285);
|
|
37
|
+
--border: oklch(1 0 0 / 12%);
|
|
38
|
+
--border-strong: oklch(1 0 0 / 22%);
|
|
39
|
+
--card: oklch(0.21 0.006 285);
|
|
40
|
+
--card-foreground: oklch(0.98 0.005 285);
|
|
41
|
+
--muted: oklch(0.25 0.006 285);
|
|
42
|
+
--muted-foreground: oklch(0.7 0.012 285);
|
|
43
|
+
--accent: oklch(0.7 0.18 290); /* brand violet */
|
|
44
|
+
--accent-foreground: oklch(0.16 0.01 285);
|
|
45
|
+
--accent-dim: oklch(0.55 0.18 290);
|
|
46
|
+
--accent-glow: oklch(0.7 0.18 290 / 35%);
|
|
47
|
+
--success: oklch(0.72 0.15 162);
|
|
48
|
+
--warning: oklch(0.8 0.19 86);
|
|
49
|
+
--danger: oklch(0.7 0.21 22);
|
|
50
|
+
--info: oklch(0.7 0.18 240);
|
|
51
|
+
|
|
52
|
+
--radius-sm: 0.25rem;
|
|
53
|
+
--radius-md: 0.375rem;
|
|
54
|
+
--radius-lg: 0.5rem;
|
|
55
|
+
--radius-xl: 0.75rem;
|
|
56
|
+
|
|
57
|
+
--shadow-panel: 0 18px 48px -12px oklch(0 0 0 / 60%),
|
|
58
|
+
0 2px 8px oklch(0 0 0 / 40%);
|
|
59
|
+
--shadow-button: 0 4px 16px -2px var(--accent-glow);
|
|
60
|
+
|
|
61
|
+
/* All devtools text uses the system font stack — never inherits the
|
|
62
|
+
* host page's font choice (which could be a marketing display face
|
|
63
|
+
* unsuited for dense UI). */
|
|
64
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
|
65
|
+
'Segoe UI', Roboto, sans-serif;
|
|
66
|
+
-webkit-font-smoothing: antialiased;
|
|
67
|
+
/* The devtools' typography baseline. */
|
|
68
|
+
font-size: 13px;
|
|
69
|
+
line-height: 1.45;
|
|
70
|
+
color: var(--foreground);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Map our tokens into Tailwind's `@theme inline` so `vdt:bg-card`,
|
|
74
|
+
* `vdt:text-muted-foreground`, `vdt:border-border` etc. resolve. */
|
|
75
|
+
@theme inline {
|
|
76
|
+
--color-background: var(--background);
|
|
77
|
+
--color-background-elevated: var(--background-elevated);
|
|
78
|
+
--color-foreground: var(--foreground);
|
|
79
|
+
--color-foreground-muted: var(--foreground-muted);
|
|
80
|
+
--color-foreground-subtle: var(--foreground-subtle);
|
|
81
|
+
--color-border: var(--border);
|
|
82
|
+
--color-border-strong: var(--border-strong);
|
|
83
|
+
--color-card: var(--card);
|
|
84
|
+
--color-card-foreground: var(--card-foreground);
|
|
85
|
+
--color-muted: var(--muted);
|
|
86
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
87
|
+
--color-accent: var(--accent);
|
|
88
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
89
|
+
--color-accent-dim: var(--accent-dim);
|
|
90
|
+
--color-success: var(--success);
|
|
91
|
+
--color-warning: var(--warning);
|
|
92
|
+
--color-danger: var(--danger);
|
|
93
|
+
--color-info: var(--info);
|
|
94
|
+
|
|
95
|
+
--radius-sm: var(--radius-sm);
|
|
96
|
+
--radius-md: var(--radius-md);
|
|
97
|
+
--radius-lg: var(--radius-lg);
|
|
98
|
+
--radius-xl: var(--radius-xl);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ---- Reset (scoped — never bleeds into host) ---- */
|
|
102
|
+
|
|
103
|
+
.vdt-scope,
|
|
104
|
+
.vdt-scope *,
|
|
105
|
+
.vdt-scope *::before,
|
|
106
|
+
.vdt-scope *::after {
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Reset attributes Tailwind utilities will override; touch nothing
|
|
111
|
+
* Tailwind owns. Using `all: revert` for the bg/border/padding triple
|
|
112
|
+
* would also work, but the explicit form is easier to reason about.
|
|
113
|
+
*
|
|
114
|
+
* `background-color`/`border`/`padding` are deliberately NOT reset
|
|
115
|
+
* here — Tailwind's `vdt:bg-*`, `vdt:border-*`, `vdt:p-*` utilities
|
|
116
|
+
* use single-class selectors which a `.vdt-scope button` reset would
|
|
117
|
+
* out-specify, leaving every button visually transparent. */
|
|
118
|
+
.vdt-scope button {
|
|
119
|
+
font: inherit;
|
|
120
|
+
color: inherit;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.vdt-scope kbd,
|
|
125
|
+
.vdt-scope code,
|
|
126
|
+
.vdt-scope pre {
|
|
127
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
128
|
+
'Liberation Mono', 'Courier New', monospace;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Custom scrollbar for any scrollable surface inside the scope. Thin,
|
|
132
|
+
* theme-aware, the thumb brightens on hover. */
|
|
133
|
+
.vdt-scope * {
|
|
134
|
+
scrollbar-width: thin;
|
|
135
|
+
scrollbar-color: var(--border-strong) transparent;
|
|
136
|
+
}
|
|
137
|
+
.vdt-scope *::-webkit-scrollbar {
|
|
138
|
+
width: 8px;
|
|
139
|
+
height: 8px;
|
|
140
|
+
}
|
|
141
|
+
.vdt-scope *::-webkit-scrollbar-track { background: transparent; }
|
|
142
|
+
.vdt-scope *::-webkit-scrollbar-thumb {
|
|
143
|
+
background: var(--border-strong);
|
|
144
|
+
border-radius: 999px;
|
|
145
|
+
border: 2px solid transparent;
|
|
146
|
+
background-clip: padding-box;
|
|
147
|
+
}
|
|
148
|
+
.vdt-scope *::-webkit-scrollbar-thumb:hover {
|
|
149
|
+
background-color: var(--muted-foreground);
|
|
150
|
+
background-clip: padding-box;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Tab bar scrolls horizontally when there are too many tabs to fit
|
|
154
|
+
* the panel width, but we hide the scrollbar chrome — a permanent
|
|
155
|
+
* 8px-tall scroller below the tab row looks like a UI bug. The row
|
|
156
|
+
* stays draggable + wheel-scrollable; the visible affordance is the
|
|
157
|
+
* cut-off-on-the-right last tab. */
|
|
158
|
+
.vdt-scope .vdt-tablist {
|
|
159
|
+
scrollbar-width: none;
|
|
160
|
+
/* Fade-mask on both horizontal edges so the user gets a visual hint
|
|
161
|
+
* that the row is scrollable when a tab is partially hidden. Symmetric
|
|
162
|
+
* so it stays looking intentional even when content fits without
|
|
163
|
+
* overflow (the fade barely registers at the inner edge of the first
|
|
164
|
+
* / last tab in that case). 18px is wide enough to clip the last
|
|
165
|
+
* character of a tab label cleanly without smearing the badge pill. */
|
|
166
|
+
-webkit-mask-image: linear-gradient(
|
|
167
|
+
to right,
|
|
168
|
+
transparent 0,
|
|
169
|
+
black 18px,
|
|
170
|
+
black calc(100% - 18px),
|
|
171
|
+
transparent 100%
|
|
172
|
+
);
|
|
173
|
+
mask-image: linear-gradient(
|
|
174
|
+
to right,
|
|
175
|
+
transparent 0,
|
|
176
|
+
black 18px,
|
|
177
|
+
black calc(100% - 18px),
|
|
178
|
+
transparent 100%
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
.vdt-scope .vdt-tablist::-webkit-scrollbar {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* The fixed-position host element sits above EVERYTHING on the host
|
|
186
|
+
* page. 2^31 - 1 is the maximum 32-bit signed int — defensive against
|
|
187
|
+
* host pages that use absurd z-index values for their own modals. */
|
|
188
|
+
.vdt-host {
|
|
189
|
+
position: fixed;
|
|
190
|
+
z-index: 2147483647;
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
}
|
|
193
|
+
.vdt-host > * {
|
|
194
|
+
pointer-events: auto;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Accent text shadow used on the floating button. */
|
|
198
|
+
.vdt-glow {
|
|
199
|
+
box-shadow: var(--shadow-button);
|
|
200
|
+
}
|
|
201
|
+
.vdt-panel-shadow {
|
|
202
|
+
box-shadow: var(--shadow-panel);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Animations — small library so we don't have to pull a motion lib. */
|
|
206
|
+
@keyframes vdt-fade-in {
|
|
207
|
+
from { opacity: 0; transform: scale(0.96); }
|
|
208
|
+
to { opacity: 1; transform: scale(1); }
|
|
209
|
+
}
|
|
210
|
+
@keyframes vdt-slide-up {
|
|
211
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
212
|
+
to { opacity: 1; transform: translateY(0); }
|
|
213
|
+
}
|
|
214
|
+
/* Ambient halo on the floating button.
|
|
215
|
+
*
|
|
216
|
+
* Strategy: a pseudo-element behind the button carries a CONIC
|
|
217
|
+
* gradient of brand violet — bright at one slice, fading through
|
|
218
|
+
* dim at others — that rotates slowly. The asymmetry rotating
|
|
219
|
+
* creates the "music visualizer / lighthouse beam" feel; a SECOND
|
|
220
|
+
* animation breathes the pseudo's opacity for the intensity pulse.
|
|
221
|
+
*
|
|
222
|
+
* Two timings on different cycles (rotation 7s, breath 4.2s) means
|
|
223
|
+
* the two motions desync — the glow never lands at the same shape
|
|
224
|
+
* twice in a row, which is what makes it read as "alive" instead of
|
|
225
|
+
* a metronome. */
|
|
226
|
+
@keyframes vdt-glow-rotate {
|
|
227
|
+
to { transform: rotate(360deg); }
|
|
228
|
+
}
|
|
229
|
+
@keyframes vdt-glow-breathe {
|
|
230
|
+
0%, 100% { opacity: 0.35; }
|
|
231
|
+
50% { opacity: 1; }
|
|
232
|
+
}
|
|
233
|
+
@media (prefers-reduced-motion: reduce) {
|
|
234
|
+
@keyframes vdt-glow-rotate { to { transform: rotate(0deg); } }
|
|
235
|
+
@keyframes vdt-glow-breathe { 0%, 100% { opacity: 0.5; } }
|
|
236
|
+
}
|
|
237
|
+
.vdt-scope .vdt-anim-pop {
|
|
238
|
+
animation: vdt-fade-in 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
239
|
+
}
|
|
240
|
+
.vdt-scope .vdt-anim-slide {
|
|
241
|
+
animation: vdt-slide-up 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
242
|
+
}
|
|
243
|
+
/* Halo carrier — applied via the `.vdt-pulse` class on the button.
|
|
244
|
+
*
|
|
245
|
+
* Implemented as a thin ring HUGGING the button rim, not a blooming
|
|
246
|
+
* cloud floating outside it. Two layered pseudo-elements:
|
|
247
|
+
*
|
|
248
|
+
* ::before — the "outer glow" — a soft, slightly larger ring that
|
|
249
|
+
* bleeds 5px past the rim. Carries the conic gradient
|
|
250
|
+
* + rotation so the asymmetry travels around the edge.
|
|
251
|
+
* ::after — the "inner contact" — a sharper ring tight to the
|
|
252
|
+
* rim. Picks up the same conic gradient + rotation so
|
|
253
|
+
* the rotating bright slice is visible at the actual
|
|
254
|
+
* border, not just in the soft outer aura.
|
|
255
|
+
*
|
|
256
|
+
* Each pseudo uses a `mask: radial-gradient(...)` cut-out so only an
|
|
257
|
+
* annulus (donut) of the conic gradient is visible — the inner area
|
|
258
|
+
* of the pseudo never paints, and the button's dark card background
|
|
259
|
+
* stays uniform behind the icon. Without the mask the gradient would
|
|
260
|
+
* fill the whole circle (including the area BEHIND the icon), making
|
|
261
|
+
* the halo read as a floating coloured disc instead of a rim glow.
|
|
262
|
+
*
|
|
263
|
+
* `isolation: isolate` pins both pseudos in the button's stacking
|
|
264
|
+
* context so the `z-index: -1` halos can't bleed behind host-page
|
|
265
|
+
* positioned content. */
|
|
266
|
+
.vdt-scope .vdt-pulse {
|
|
267
|
+
position: relative;
|
|
268
|
+
isolation: isolate;
|
|
269
|
+
}
|
|
270
|
+
.vdt-scope .vdt-pulse::before,
|
|
271
|
+
.vdt-scope .vdt-pulse::after {
|
|
272
|
+
content: '';
|
|
273
|
+
position: absolute;
|
|
274
|
+
border-radius: inherit;
|
|
275
|
+
background: conic-gradient(
|
|
276
|
+
from 0deg,
|
|
277
|
+
oklch(0.7 0.18 290 / 0%) 0deg,
|
|
278
|
+
oklch(0.7 0.18 290 / 90%) 55deg,
|
|
279
|
+
oklch(0.7 0.18 290 / 15%) 170deg,
|
|
280
|
+
oklch(0.7 0.18 290 / 70%) 240deg,
|
|
281
|
+
oklch(0.7 0.18 290 / 0%) 360deg
|
|
282
|
+
);
|
|
283
|
+
z-index: -1;
|
|
284
|
+
pointer-events: none;
|
|
285
|
+
animation:
|
|
286
|
+
vdt-glow-rotate 7000ms linear infinite,
|
|
287
|
+
vdt-glow-breathe 4200ms ease-in-out infinite;
|
|
288
|
+
/* Transition picks up when the animation is removed (see the
|
|
289
|
+
* `[data-open="true"]` override on .vdt-surface). The animated
|
|
290
|
+
* opacity controls the value while the animation is active; when
|
|
291
|
+
* the animation is dropped, this transition interpolates from
|
|
292
|
+
* whatever value the animation left to the static rule's value. */
|
|
293
|
+
transition: opacity 200ms ease;
|
|
294
|
+
}
|
|
295
|
+
/* Outer soft aura — bleeds just past the rim. The mask keeps the
|
|
296
|
+
* INNER 60% transparent, so paint exists only as a soft ring around
|
|
297
|
+
* the button's silhouette. Blur turns it into a glow. */
|
|
298
|
+
.vdt-scope .vdt-pulse::before {
|
|
299
|
+
inset: -5px;
|
|
300
|
+
-webkit-mask: radial-gradient(closest-side, transparent 60%, black 100%);
|
|
301
|
+
mask: radial-gradient(closest-side, transparent 60%, black 100%);
|
|
302
|
+
filter: blur(6px);
|
|
303
|
+
}
|
|
304
|
+
/* Inner sharp ring — sits exactly on the rim. The narrower mask
|
|
305
|
+
* window (70–90%) gives a 1–2px coloured edge that traces the
|
|
306
|
+
* border itself. This is what makes the rotation read as "the rim
|
|
307
|
+
* is pulsing/wabbering" rather than as a separate aura. */
|
|
308
|
+
.vdt-scope .vdt-pulse::after {
|
|
309
|
+
inset: 0;
|
|
310
|
+
-webkit-mask: radial-gradient(closest-side, transparent 70%, black 90%, transparent 100%);
|
|
311
|
+
mask: radial-gradient(closest-side, transparent 70%, black 90%, transparent 100%);
|
|
312
|
+
filter: blur(1px);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Continuous rotation for the spinner icon. */
|
|
316
|
+
@keyframes vdt-spin {
|
|
317
|
+
to { transform: rotate(360deg); }
|
|
318
|
+
}
|
|
319
|
+
.vdt-scope .vdt-spinner {
|
|
320
|
+
animation: vdt-spin 900ms linear infinite;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* ---- Morphing floating button ----------------------------------------
|
|
324
|
+
* Idle: 48×48 circle, brand-violet glow (the `vdt-pulse` keyframes
|
|
325
|
+
* above own this).
|
|
326
|
+
* Busy: pill, ~ICON + LABEL wide, faster pulse cadence so users
|
|
327
|
+
* perceive movement. The width transition is what makes the
|
|
328
|
+
* Next.js-style morph feel.
|
|
329
|
+
*
|
|
330
|
+
* We animate width via `width: auto` indirection: use a CSS variable
|
|
331
|
+
* `--vdt-fab-width` set to either `48px` (idle) or `auto` won't
|
|
332
|
+
* transition; so we set explicit `min-width: 48px` + use a content-
|
|
333
|
+
* aware approach with `width: max-content` and a tracked `--vdt-fab-w`
|
|
334
|
+
* the JS reads. Simpler approach for now: use `width: max-content` +
|
|
335
|
+
* `transition` on `min-width` + `border-radius` + `padding`.
|
|
336
|
+
*
|
|
337
|
+
* The transition timing is calibrated to feel like the Next dev
|
|
338
|
+
* indicator — fast enough to feel snappy, slow enough that the eye
|
|
339
|
+
* tracks the morph. */
|
|
340
|
+
/* ---- Morphing surface -------------------------------------------------
|
|
341
|
+
*
|
|
342
|
+
* Single DOM element that holds both the FAB icon and the full panel
|
|
343
|
+
* content as absolutely-positioned layers. The `data-open` attribute
|
|
344
|
+
* drives the morph: width, height, and border-radius transition
|
|
345
|
+
* together. The two inner layers crossfade via opacity + pointer-
|
|
346
|
+
* events so clicks land on the right surface at the right time.
|
|
347
|
+
*
|
|
348
|
+
* State table:
|
|
349
|
+
*
|
|
350
|
+
* data-open data-busy → size shape layer
|
|
351
|
+
* false false → 48px × 48px circle FAB visible
|
|
352
|
+
* false true → 140px × 48px pill FAB visible (busy)
|
|
353
|
+
* true * → 420px × 60vh rounded panel visible
|
|
354
|
+
*
|
|
355
|
+
* The busy + open combination falls through to "open" — once the
|
|
356
|
+
* panel is showing, the busy pill shape isn't relevant. The status
|
|
357
|
+
* still shows as a small chip inside the panel header (TODO).
|
|
358
|
+
*
|
|
359
|
+
* Width / height / border-radius all use the same cubic-bezier curve
|
|
360
|
+
* so the morph reads as one coordinated motion. Transform is on its
|
|
361
|
+
* own (slightly shorter) timing for the hover/active scale because
|
|
362
|
+
* the curve overlap is intentional — the press-down lands a beat
|
|
363
|
+
* before the morph completes, making clicks feel responsive. */
|
|
364
|
+
.vdt-scope .vdt-surface {
|
|
365
|
+
position: relative;
|
|
366
|
+
isolation: isolate;
|
|
367
|
+
display: block;
|
|
368
|
+
width: 48px;
|
|
369
|
+
height: 48px;
|
|
370
|
+
background: var(--card);
|
|
371
|
+
border-radius: 999px;
|
|
372
|
+
/* Hover-only baseline. Overridden by :hover / :active below. */
|
|
373
|
+
transform: scale(1);
|
|
374
|
+
transform-origin: center;
|
|
375
|
+
will-change: transform, width, height, border-radius;
|
|
376
|
+
/* Curves picked to feel like one surface morphing — same cubic-
|
|
377
|
+
* bezier on every layout property, transform faster so it doesn't
|
|
378
|
+
* lag. */
|
|
379
|
+
transition:
|
|
380
|
+
transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
381
|
+
width 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
382
|
+
height 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
383
|
+
border-radius 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
384
|
+
background 180ms ease;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/* Closed + busy = pill (compile / loading / reconnecting indicator).
|
|
388
|
+
* Width is content-driven via max-content so short labels ("Loading",
|
|
389
|
+
* "Build error") sit in a tight pill and longer ones ("Reconnecting"
|
|
390
|
+
* + animated dots) get exactly the room they need. Width transition
|
|
391
|
+
* between 48px circle and intrinsic pill width does not smoothly
|
|
392
|
+
* interpolate via CSS — that's the trade-off for content sizing.
|
|
393
|
+
* The other morph properties (height, border-radius, background)
|
|
394
|
+
* still animate, so the change reads as one coordinated motion. */
|
|
395
|
+
.vdt-scope .vdt-surface[data-busy="true"]:not([data-open="true"]) {
|
|
396
|
+
width: max-content;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* Open = full panel. The container clamps to the viewport on small
|
|
400
|
+
* screens (max-width calc keeps it from overflowing the host edge).
|
|
401
|
+
* 560px is the smallest width that fits all six tabs + their badges
|
|
402
|
+
* on one row without the tablist needing to scroll in the common
|
|
403
|
+
* case; tablist itself is overflow-x:auto so narrower viewports
|
|
404
|
+
* (max-width clamp triggers) still get all tabs, just behind a
|
|
405
|
+
* horizontal scroll. */
|
|
406
|
+
.vdt-scope .vdt-surface[data-open="true"] {
|
|
407
|
+
width: 560px;
|
|
408
|
+
max-width: calc(100vw - 32px);
|
|
409
|
+
height: 60vh;
|
|
410
|
+
max-height: 720px;
|
|
411
|
+
min-height: 400px;
|
|
412
|
+
border-radius: 8px;
|
|
413
|
+
/* Box-shadow gives the open panel a clear lift off the page; the
|
|
414
|
+
* rotating halo fades out via the pseudo's opacity below. */
|
|
415
|
+
box-shadow: var(--shadow-panel);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/* Hover / active scale — closed state only. The panel is too big to
|
|
419
|
+
* usefully scale; doing so would feel noisy. */
|
|
420
|
+
.vdt-scope .vdt-surface:not([data-open="true"]):hover {
|
|
421
|
+
transform: scale(1.08);
|
|
422
|
+
}
|
|
423
|
+
.vdt-scope .vdt-surface:not([data-open="true"]):active {
|
|
424
|
+
transform: scale(0.96);
|
|
425
|
+
transition-duration: 80ms, 320ms, 320ms, 320ms, 180ms;
|
|
426
|
+
}
|
|
427
|
+
@media (prefers-reduced-motion: reduce) {
|
|
428
|
+
.vdt-scope .vdt-surface,
|
|
429
|
+
.vdt-scope .vdt-surface:hover,
|
|
430
|
+
.vdt-scope .vdt-surface:active {
|
|
431
|
+
transform: scale(1);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/* Halo on the surface — the rotating conic-gradient + radial-mask
|
|
436
|
+
* combination is designed for a CIRCULAR surface. Both the masked
|
|
437
|
+
* region (`closest-side` radial → circle) and the gradient's visual
|
|
438
|
+
* weight assume a square aspect.
|
|
439
|
+
*
|
|
440
|
+
* When the surface stops being square (busy pill = 140×48; open
|
|
441
|
+
* panel = 420×60vh) the mask cuts a circular hole through a
|
|
442
|
+
* rectangle, leaving visible "lobes" of conic colour at the long
|
|
443
|
+
* ends that don't match the pill / panel outline. Hide it entirely
|
|
444
|
+
* in those states. The pill state gets its own shape-appropriate
|
|
445
|
+
* pulse below; the panel state is just clean (the box-shadow lift
|
|
446
|
+
* carries the visual hierarchy).
|
|
447
|
+
*
|
|
448
|
+
* `animation: none` (not `play-state: paused`) so the animated
|
|
449
|
+
* opacity stops controlling the pseudo — the static `opacity: 0`
|
|
450
|
+
* + the transition on the base rule then fade the halo out cleanly. */
|
|
451
|
+
.vdt-scope .vdt-surface[data-open="true"]::before,
|
|
452
|
+
.vdt-scope .vdt-surface[data-open="true"]::after,
|
|
453
|
+
.vdt-scope .vdt-surface[data-busy="true"]:not([data-open="true"])::before,
|
|
454
|
+
.vdt-scope .vdt-surface[data-busy="true"]:not([data-open="true"])::after {
|
|
455
|
+
opacity: 0;
|
|
456
|
+
animation: none;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/* Busy pill: replace the rotating halo with a shape-appropriate
|
|
460
|
+
* pulsing outline glow. `box-shadow` follows the surface's actual
|
|
461
|
+
* `border-radius: 999px`, so the glow traces the pill perimeter
|
|
462
|
+
* exactly — no mask shape mismatch. The pulse is shorter than the
|
|
463
|
+
* idle halo's breath (2.4s vs 4.2s) so the "something's happening"
|
|
464
|
+
* cadence matches the loading semantics.
|
|
465
|
+
*
|
|
466
|
+
* `--pill-glow` is the per-kind colour; defaults to brand violet,
|
|
467
|
+
* overridden by the `[data-kind]` selectors below for reconnecting
|
|
468
|
+
* (amber) and error (red). Pulling the colour through a custom prop
|
|
469
|
+
* means the @keyframes don't need to be duplicated per kind. */
|
|
470
|
+
.vdt-scope .vdt-surface {
|
|
471
|
+
--pill-glow: oklch(0.7 0.18 290); /* brand violet — default */
|
|
472
|
+
}
|
|
473
|
+
.vdt-scope .vdt-surface[data-kind="reconnecting"] {
|
|
474
|
+
--pill-glow: oklch(0.78 0.16 75); /* warning amber */
|
|
475
|
+
}
|
|
476
|
+
.vdt-scope .vdt-surface[data-kind="error"] {
|
|
477
|
+
--pill-glow: oklch(0.68 0.22 22); /* danger red */
|
|
478
|
+
}
|
|
479
|
+
@keyframes vdt-pill-pulse {
|
|
480
|
+
0%, 100% {
|
|
481
|
+
box-shadow:
|
|
482
|
+
0 0 0 1px color-mix(in oklch, var(--pill-glow) 25%, transparent),
|
|
483
|
+
0 0 14px color-mix(in oklch, var(--pill-glow) 25%, transparent);
|
|
484
|
+
}
|
|
485
|
+
50% {
|
|
486
|
+
box-shadow:
|
|
487
|
+
0 0 0 1.5px color-mix(in oklch, var(--pill-glow) 60%, transparent),
|
|
488
|
+
0 0 28px color-mix(in oklch, var(--pill-glow) 60%, transparent);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
@media (prefers-reduced-motion: reduce) {
|
|
492
|
+
@keyframes vdt-pill-pulse {
|
|
493
|
+
0%, 100% {
|
|
494
|
+
box-shadow:
|
|
495
|
+
0 0 0 1px color-mix(in oklch, var(--pill-glow) 35%, transparent),
|
|
496
|
+
0 0 14px color-mix(in oklch, var(--pill-glow) 35%, transparent);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
.vdt-scope .vdt-surface[data-busy="true"]:not([data-open="true"]) {
|
|
501
|
+
animation: vdt-pill-pulse 2400ms ease-in-out infinite;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/* Per-kind tweaks for the FAB layer: the icon + label re-colour to
|
|
505
|
+
* match the pill's outline-glow so the surface reads as one cohesive
|
|
506
|
+
* state. Reconnecting = amber (warning); error = red (danger). */
|
|
507
|
+
.vdt-scope .vdt-surface[data-kind="reconnecting"] .vdt-fab-layer {
|
|
508
|
+
color: var(--warning);
|
|
509
|
+
}
|
|
510
|
+
.vdt-scope .vdt-surface[data-kind="error"] .vdt-fab-layer {
|
|
511
|
+
color: var(--danger);
|
|
512
|
+
}
|
|
513
|
+
.vdt-scope .vdt-surface[data-kind="reconnecting"] .vdt-fab-label,
|
|
514
|
+
.vdt-scope .vdt-surface[data-kind="error"] .vdt-fab-label {
|
|
515
|
+
color: var(--foreground);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/* ---- FAB layer ---------------------------------------------------------
|
|
519
|
+
*
|
|
520
|
+
* The button face visible in the closed state. Stays in normal flow
|
|
521
|
+
* (NOT position:absolute) so its content contributes to the surface's
|
|
522
|
+
* intrinsic size — that's load-bearing for the busy-pill state, which
|
|
523
|
+
* uses `width: max-content` on the surface to size the pill to its
|
|
524
|
+
* label. Absolutely-positioned children don't participate in the
|
|
525
|
+
* parent's intrinsic size per CSS spec, so the original `position:
|
|
526
|
+
* absolute; inset: 0` collapsed the busy pill to 0 width (visible only
|
|
527
|
+
* as the outline-glow box-shadow stripe).
|
|
528
|
+
*
|
|
529
|
+
* The panel-layer is still absolutely positioned over this so the
|
|
530
|
+
* crossfade morph works — when open, fab-layer is opacity:0 + sized
|
|
531
|
+
* to fill (width/height 100%) so the surface's geometry comes from
|
|
532
|
+
* the explicit panel dimensions, not the fab content. */
|
|
533
|
+
.vdt-scope .vdt-fab-layer {
|
|
534
|
+
position: relative;
|
|
535
|
+
width: 48px;
|
|
536
|
+
height: 48px;
|
|
537
|
+
display: inline-flex;
|
|
538
|
+
align-items: center;
|
|
539
|
+
justify-content: center;
|
|
540
|
+
gap: 0;
|
|
541
|
+
padding: 0;
|
|
542
|
+
border: 0;
|
|
543
|
+
background: transparent;
|
|
544
|
+
color: var(--accent);
|
|
545
|
+
cursor: pointer;
|
|
546
|
+
border-radius: inherit;
|
|
547
|
+
transition:
|
|
548
|
+
/* Slightly faster fade-out than the morph so the FAB disappears
|
|
549
|
+
* before the panel layer arrives — clean handoff between layers. */
|
|
550
|
+
opacity 160ms ease,
|
|
551
|
+
/* Inside-the-layer transitions for the busy-pill morph. */
|
|
552
|
+
width 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
553
|
+
padding 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
554
|
+
gap 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
555
|
+
}
|
|
556
|
+
.vdt-scope .vdt-surface[data-busy="true"]:not([data-open="true"]) .vdt-fab-layer {
|
|
557
|
+
/* Pill grows to fit content: spinner + gap + label-text + dots,
|
|
558
|
+
* plus the asymmetric padding (12 left for the icon, 16 right for
|
|
559
|
+
* breathing room after the label). `width: auto` is what makes the
|
|
560
|
+
* surface's `width: max-content` actually size to the label. */
|
|
561
|
+
width: auto;
|
|
562
|
+
padding: 0 16px 0 12px;
|
|
563
|
+
gap: 8px;
|
|
564
|
+
}
|
|
565
|
+
.vdt-scope .vdt-surface[data-open="true"] .vdt-fab-layer {
|
|
566
|
+
/* Open state: fab-layer fades out, but it must still fill the
|
|
567
|
+
* surface so the morph animation's geometry stays smooth. */
|
|
568
|
+
opacity: 0;
|
|
569
|
+
pointer-events: none;
|
|
570
|
+
width: 100%;
|
|
571
|
+
height: 100%;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.vdt-scope .vdt-fab-label {
|
|
575
|
+
display: inline-block;
|
|
576
|
+
font-size: 12px;
|
|
577
|
+
font-weight: 600;
|
|
578
|
+
letter-spacing: 0.01em;
|
|
579
|
+
color: var(--foreground);
|
|
580
|
+
white-space: nowrap;
|
|
581
|
+
opacity: 0;
|
|
582
|
+
max-width: 0;
|
|
583
|
+
overflow: hidden;
|
|
584
|
+
transition:
|
|
585
|
+
opacity 220ms ease,
|
|
586
|
+
max-width 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
587
|
+
}
|
|
588
|
+
.vdt-scope .vdt-surface[data-busy="true"]:not([data-open="true"]) .vdt-fab-label {
|
|
589
|
+
opacity: 1;
|
|
590
|
+
/* No cap — pill scales to fit. Status pushers must supply short
|
|
591
|
+
* labels ("Build error", "Reconnecting", "Loading"); long error
|
|
592
|
+
* details belong in the console / error panel, not the pill. */
|
|
593
|
+
max-width: max-content;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/* Animated three-dot ticker after labels like "Reconnecting" /
|
|
597
|
+
* "Loading" / "Compiling". The dots are physical <span> elements
|
|
598
|
+
* (one per dot) so we can stagger their fade-ins independently
|
|
599
|
+
* — `content`-based dot animations have spotty browser support.
|
|
600
|
+
*
|
|
601
|
+
* Pattern: each dot fades in with a 180ms delay relative to the
|
|
602
|
+
* previous one, then they all fade out together. Loops every 1.4s,
|
|
603
|
+
* matching the cadence of a typewriter cursor. Width is reserved
|
|
604
|
+
* via fixed-em sizing so the pill doesn't reflow as dots tick. */
|
|
605
|
+
.vdt-scope .vdt-dots {
|
|
606
|
+
display: inline-flex;
|
|
607
|
+
align-items: baseline;
|
|
608
|
+
gap: 1px;
|
|
609
|
+
margin-left: 1px;
|
|
610
|
+
}
|
|
611
|
+
.vdt-scope .vdt-dots > span {
|
|
612
|
+
display: inline-block;
|
|
613
|
+
width: 3px;
|
|
614
|
+
height: 3px;
|
|
615
|
+
background: currentColor;
|
|
616
|
+
border-radius: 50%;
|
|
617
|
+
opacity: 0.25;
|
|
618
|
+
animation: vdt-dot-tick 1400ms ease-in-out infinite;
|
|
619
|
+
}
|
|
620
|
+
.vdt-scope .vdt-dots > span:nth-child(2) { animation-delay: 180ms; }
|
|
621
|
+
.vdt-scope .vdt-dots > span:nth-child(3) { animation-delay: 360ms; }
|
|
622
|
+
@keyframes vdt-dot-tick {
|
|
623
|
+
0%, 100% { opacity: 0.25; transform: translateY(0); }
|
|
624
|
+
35% { opacity: 1; transform: translateY(-1px); }
|
|
625
|
+
60% { opacity: 0.4; transform: translateY(0); }
|
|
626
|
+
}
|
|
627
|
+
@media (prefers-reduced-motion: reduce) {
|
|
628
|
+
.vdt-scope .vdt-dots > span {
|
|
629
|
+
animation: none;
|
|
630
|
+
opacity: 0.6;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/* ---- Panel layer -------------------------------------------------------
|
|
635
|
+
*
|
|
636
|
+
* The panel content (header, tabs, body) visible in the open state.
|
|
637
|
+
* `display: flex` always, so the layout is computed in the background
|
|
638
|
+
* while invisible. The fade-in is delayed slightly so the morph
|
|
639
|
+
* finishes its first ~180ms unobstructed, then content appears. */
|
|
640
|
+
.vdt-scope .vdt-panel-layer {
|
|
641
|
+
position: absolute;
|
|
642
|
+
inset: 0;
|
|
643
|
+
display: flex;
|
|
644
|
+
flex-direction: column;
|
|
645
|
+
overflow: hidden;
|
|
646
|
+
border-radius: inherit;
|
|
647
|
+
opacity: 0;
|
|
648
|
+
pointer-events: none;
|
|
649
|
+
transition:
|
|
650
|
+
opacity 200ms ease 140ms;
|
|
651
|
+
}
|
|
652
|
+
.vdt-scope .vdt-surface[data-open="true"] .vdt-panel-layer {
|
|
653
|
+
opacity: 1;
|
|
654
|
+
pointer-events: auto;
|
|
655
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@voltro/devtools",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Local admin / devtools surface over a running app's /_voltro/inspect/* — routes, RPC, workflows, schedules, cache, logs, and traces.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"voltro",
|
|
7
|
+
"typescript",
|
|
8
|
+
"framework"
|
|
9
|
+
],
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
11
|
+
"homepage": "https://voltro.dev",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"email": "support@voltro.dev"
|
|
14
|
+
},
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Voltro UG",
|
|
17
|
+
"url": "https://voltro.dev"
|
|
18
|
+
},
|
|
19
|
+
"type": "module",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./styles.css": "./dist/styles.css"
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=24.0.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@voltro/client": "0.1.0",
|
|
37
|
+
"@voltro/logger": "0.1.0",
|
|
38
|
+
"@voltro/web": "0.1.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"react": "^19.0.0",
|
|
42
|
+
"react-dom": "^19.0.0"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
}
|
|
47
|
+
}
|