-
-
Notifications
You must be signed in to change notification settings - Fork 433
Expand file tree
/
Copy pathSkeleton.vue
More file actions
479 lines (443 loc) · 17.5 KB
/
Skeleton.vue
File metadata and controls
479 lines (443 loc) · 17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
<script setup lang="ts"></script>
<template>
<article
aria-busy="true"
:aria-label="$t('package.skeleton.loading')"
class="package-page motion-safe:animate-fade-in"
>
<!-- Package header — matches area-header in [...name].vue -->
<header class="area-header sticky top-14 z-1 bg-[--bg] py-2">
<div class="flex items-baseline gap-x-2 gap-y-1 sm:gap-x-3 flex-wrap min-w-0">
<!-- Package name -->
<div class="min-w-0">
<h1 class="font-mono text-2xl sm:text-3xl font-medium">
<SkeletonInline class="h-9 w-48" />
</h1>
</div>
<!-- Version -->
<span class="inline-flex items-baseline font-mono text-base sm:text-lg shrink-0">
<SkeletonInline class="h-6 w-20" />
</span>
<!-- Docs + Code + Compare nav placeholder (hidden on mobile) -->
<div
class="hidden sm:flex items-center gap-0.5 p-0.5 bg-bg-subtle border border-border-subtle rounded-md shrink-0 ms-auto self-center"
>
<SkeletonInline class="h-7 w-22 rounded" />
<SkeletonInline class="h-7 w-20 rounded" />
<SkeletonInline class="h-7 w-26 rounded" />
</div>
<!-- Metrics badges + likes — matches basis-full flex row -->
<div class="basis-full flex gap-2 sm:gap-3 flex-wrap items-stretch">
<!-- Badge row (Types, ESM, CJS, CJS-ghost) -->
<div class="flex items-center gap-1.5 self-baseline">
<SkeletonBlock class="w-16 h-5.5 rounded" />
<SkeletonBlock class="w-13 h-5.5 rounded" />
<SkeletonBlock class="w-13 h-5.5 rounded" />
<SkeletonBlock class="w-13 h-5.5 rounded bg-bg-subtle" />
</div>
<!-- Likes button placeholder -->
<SkeletonBlock class="w-14 h-5.5 rounded self-baseline" />
</div>
</div>
</header>
<!-- Package details — matches area-details in [...name].vue -->
<section class="area-details">
<div class="mb-4">
<!-- Description -->
<div class="max-w-2xl">
<div class="space-y-2">
<SkeletonBlock class="h-5 w-full" />
<SkeletonBlock class="h-5 w-4/5" />
<SkeletonBlock class="h-5 w-3/5" />
</div>
</div>
<!-- External links -->
<ul
class="flex flex-wrap items-center gap-x-3 gap-y-1.5 sm:gap-4 list-none m-0 p-0 mt-3 text-sm"
>
<li><SkeletonInline class="h-5 w-28" /></li>
<li><SkeletonInline class="h-5 w-14" /></li>
<li><SkeletonInline class="h-5 w-16" /></li>
<li><SkeletonInline class="h-5 w-10" /></li>
</ul>
</div>
<!-- Stats grid — matches dl in [...name].vue -->
<dl
class="grid grid-cols-2 sm:grid-cols-7 md:grid-cols-11 gap-3 sm:gap-4 py-4 sm:py-6 mt-4 sm:mt-6 border-t border-b border-border"
>
<!-- License -->
<div class="space-y-1 sm:col-span-2">
<dt class="text-xs text-fg-subtle uppercase tracking-wider">
{{ $t('package.stats.license') }}
</dt>
<dd class="font-mono text-sm">
<SkeletonInline class="h-5 w-12" />
</dd>
</div>
<!-- Deps -->
<div class="space-y-1 sm:col-span-2">
<dt class="text-xs text-fg-subtle uppercase tracking-wider">
{{ $t('package.stats.deps') }}
</dt>
<dd class="font-mono text-sm">
<SkeletonInline class="h-5 w-12" />
</dd>
</div>
<!-- Install Size -->
<div class="space-y-1 sm:col-span-3">
<dt class="text-xs text-fg-subtle uppercase tracking-wider">
{{ $t('package.stats.install_size') }}
</dt>
<dd class="font-mono text-sm">
<SkeletonInline class="h-5 w-16" />
</dd>
</div>
<!-- Vulns -->
<div class="space-y-1 sm:col-span-2">
<dt class="text-xs text-fg-subtle uppercase tracking-wider">
{{ $t('package.stats.vulns') }}
</dt>
<dd class="font-mono text-sm text-fg-subtle">-</dd>
</div>
<!-- Published -->
<div class="space-y-1 sm:col-span-2">
<dt class="text-xs text-fg-subtle uppercase tracking-wider">
{{ $t('package.stats.published') }}
</dt>
<dd class="font-mono text-sm">
<SkeletonInline class="h-5 w-28" />
</dd>
</div>
</dl>
</section>
<!-- Install section — matches area-install in [...name].vue -->
<section class="area-install scroll-mt-20">
<div class="flex flex-wrap items-center justify-between mb-3">
<h2 class="text-xs font-mono text-fg-subtle uppercase tracking-wider">
{{ $t('package.get_started.title') }}
</h2>
<!-- Package manager select placeholder -->
<SkeletonInline class="h-7 w-24 rounded" />
</div>
<!-- Terminal-style install command — matches TerminalInstall.vue -->
<div class="bg-bg-subtle border border-border rounded-lg overflow-hidden">
<div class="flex gap-1.5 px-3 pt-2 sm:px-4 sm:pt-3">
<span class="w-2.5 h-2.5 rounded-full bg-fg-subtle" />
<span class="w-2.5 h-2.5 rounded-full bg-fg-subtle" />
<span class="w-2.5 h-2.5 rounded-full bg-fg-subtle" />
</div>
<div class="px-3 pt-2 pb-3 sm:px-4 sm:pt-3 sm:pb-4 space-y-1">
<!-- $ install command -->
<div class="flex items-center gap-2">
<span class="text-fg-subtle font-mono text-sm select-none shrink-0">$</span>
<SkeletonInline class="h-5 w-40" />
</div>
<!-- # Run locally -->
<div class="flex items-center gap-2 pt-1">
<SkeletonInline class="h-4 w-24" />
</div>
<!-- $ run command -->
<div class="flex items-center gap-2">
<span class="text-fg-subtle font-mono text-sm select-none shrink-0">$</span>
<SkeletonInline class="h-5 w-28" />
</div>
<!-- # Create new project -->
<div class="flex items-center gap-2 pt-1">
<SkeletonInline class="h-4 w-36" />
</div>
<!-- $ create command -->
<div class="flex items-center gap-2">
<span class="text-fg-subtle font-mono text-sm select-none shrink-0">$</span>
<SkeletonInline class="h-5 w-32" />
</div>
</div>
</div>
</section>
<!-- Vulns area (empty placeholder to hold grid space) -->
<div class="area-vulns" />
<!-- README — matches area-readme in [...name].vue -->
<section class="area-readme min-w-0 scroll-mt-20">
<div class="flex flex-wrap items-center justify-between mb-3 px-1">
<h2 class="text-xs font-mono text-fg-subtle uppercase tracking-wider">
{{ $t('package.readme.title') }}
</h2>
</div>
<!-- Simulated README content -->
<div class="space-y-4">
<!-- Heading -->
<SkeletonBlock class="h-7 w-2/3" />
<!-- Paragraphs -->
<SkeletonBlock class="h-4 w-full" />
<SkeletonBlock class="h-4 w-full" />
<SkeletonBlock class="h-4 w-4/5" />
<!-- Gap for section break -->
<SkeletonBlock class="h-6 w-1/2 mt-6" />
<SkeletonBlock class="h-4 w-full" />
<SkeletonBlock class="h-4 w-full" />
<SkeletonBlock class="h-4 w-3/4" />
<!-- Code block placeholder -->
<SkeletonBlock class="h-24 w-full rounded-lg mt-4" />
<SkeletonBlock class="h-4 w-full" />
<SkeletonBlock class="h-4 w-5/6" />
</div>
</section>
<!-- Sidebar — matches area-sidebar in [...name].vue -->
<div class="area-sidebar">
<div
class="sticky top-30 xl:top-14 space-y-6 sm:space-y-8 min-w-0 overflow-y-auto pe-2.5 lg:(max-h-[calc(100dvh-8.5rem)] overscroll-contain) xl:(pt-2 max-h-[calc(100dvh-6rem)])"
>
<div class="flex flex-col gap-4 sm:gap-6 xl:(pt-2)">
<!-- Download stats — matches CollapsibleSection + sparkline skeleton -->
<section>
<div class="flex items-center justify-between mb-3 px-1">
<h2
class="text-xs font-mono text-fg-subtle uppercase tracking-wider flex items-center gap-2"
>
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-down w-3 h-3" aria-hidden="true" />
</span>
{{ $t('package.downloads.title') }}
</h2>
</div>
<div class="ms-6 max-w-xs">
<!-- Title row: fontSize * 2 = 24px -->
<div class="h-6 flex items-center ps-3">
<SkeletonInline class="h-3 w-36" />
</div>
<!-- Chart area: matches SVG viewBox 500:80 -->
<div class="aspect-[500/80] flex items-center">
<div class="w-[42%] flex items-center ps-0.5">
<SkeletonInline class="h-7 w-24" />
</div>
<div class="flex-1 flex items-end pe-3">
<SkeletonInline class="h-px w-full" />
</div>
</div>
</div>
</section>
<!-- Playgrounds — matches PackagePlaygrounds (not CollapsibleSection) -->
<section class="px-1">
<h2 class="text-xs font-mono text-fg-subtle uppercase tracking-wider mb-3">
{{ $t('package.playgrounds.title') }}
</h2>
<SkeletonBlock class="w-full h-9 rounded-md" />
</section>
<!-- Compatibility — matches CollapsibleSection -->
<section>
<div class="flex items-center justify-between mb-3 px-1">
<h2
class="text-xs font-mono text-fg-subtle uppercase tracking-wider flex items-center gap-2"
>
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-down w-3 h-3" aria-hidden="true" />
</span>
{{ $t('package.compatibility') }}
</h2>
</div>
<div class="ms-6 space-y-2">
<div class="flex justify-between gap-4 py-1">
<SkeletonInline class="h-4 w-16" />
<SkeletonInline class="h-4 w-20" />
</div>
</div>
</section>
<!-- Versions — matches CollapsibleSection + PackageVersions -->
<section>
<div class="flex items-center justify-between mb-3 px-1">
<h2
class="text-xs font-mono text-fg-subtle uppercase tracking-wider flex items-center gap-2"
>
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-down w-3 h-3" aria-hidden="true" />
</span>
{{ $t('package.skeleton.versions') }}
</h2>
</div>
<div class="ms-6 space-y-0.5 min-w-0">
<!-- Version rows with expand chevron + version + tag + date -->
<div v-for="i in 4" :key="i" class="flex items-center gap-2 px-1">
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-right w-3 h-3 text-fg-subtle" aria-hidden="true" />
</span>
<div class="flex-1 py-1.5 min-w-0 flex gap-2 justify-between items-center">
<div>
<SkeletonInline
class="h-4"
:class="i === 1 ? 'w-12' : i === 2 ? 'w-22' : i === 3 ? 'w-26' : 'w-14'"
/>
<SkeletonInline class="h-2.5 w-10 mt-0.5" />
</div>
<SkeletonInline class="h-3 w-20 shrink-0" />
</div>
</div>
<!-- Other versions row -->
<div class="flex items-center gap-2 p-1">
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-right w-3 h-3 text-fg-subtle" aria-hidden="true" />
</span>
<SkeletonInline class="h-3 w-28" />
</div>
</div>
</section>
<!-- Dependencies — matches CollapsibleSection -->
<section>
<div class="flex items-center justify-between mb-3 px-1">
<h2
class="text-xs font-mono text-fg-subtle uppercase tracking-wider flex items-center gap-2"
>
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-down w-3 h-3" aria-hidden="true" />
</span>
{{ $t('package.skeleton.dependencies') }}
</h2>
</div>
<ul class="ms-6 px-1 space-y-1 list-none m-0 p-0">
<li class="flex items-center justify-between py-1 text-sm">
<SkeletonInline class="h-4 w-24" />
<SkeletonInline class="h-4 w-12" />
</li>
<li class="flex items-center justify-between py-1 text-sm">
<SkeletonInline class="h-4 w-32" />
<SkeletonInline class="h-4 w-10" />
</li>
<li class="flex items-center justify-between py-1 text-sm">
<SkeletonInline class="h-4 w-20" />
<SkeletonInline class="h-4 w-14" />
</li>
<li class="flex items-center justify-between py-1 text-sm">
<SkeletonInline class="h-4 w-28" />
<SkeletonInline class="h-4 w-12" />
</li>
</ul>
</section>
<!-- Keywords — matches CollapsibleSection -->
<section>
<div class="flex items-center justify-between mb-3 px-1">
<h2
class="text-xs font-mono text-fg-subtle uppercase tracking-wider flex items-center gap-2"
>
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-down w-3 h-3" aria-hidden="true" />
</span>
{{ $t('package.skeleton.keywords') }}
</h2>
</div>
<ul class="ms-6 flex flex-wrap gap-1.5 list-none m-0 p-1">
<li><SkeletonInline class="h-6 w-16 rounded" /></li>
<li><SkeletonInline class="h-6 w-12 rounded" /></li>
<li><SkeletonInline class="h-6 w-20 rounded" /></li>
<li><SkeletonInline class="h-6 w-14 rounded" /></li>
<li><SkeletonInline class="h-6 w-18 rounded" /></li>
<li><SkeletonInline class="h-6 w-10 rounded" /></li>
</ul>
</section>
<!-- Maintainers — matches CollapsibleSection -->
<section>
<div class="flex items-center justify-between mb-3 px-1">
<h2
class="text-xs font-mono text-fg-subtle uppercase tracking-wider flex items-center gap-2"
>
<span class="w-4 h-4 flex items-center justify-center shrink-0">
<span class="i-carbon:chevron-down w-3 h-3" aria-hidden="true" />
</span>
{{ $t('package.skeleton.maintainers') }}
</h2>
</div>
<ul class="ms-6 space-y-2 list-none my-1 px-1">
<li><SkeletonInline class="h-5 w-28" /></li>
<li><SkeletonInline class="h-5 w-24" /></li>
</ul>
</section>
</div>
</div>
</div>
</article>
</template>
<style scoped>
.package-page {
display: grid;
gap: 2rem;
/* Mobile: single column, sidebar above readme */
grid-template-columns: minmax(0, 1fr);
grid-template-areas:
'header'
'details'
'install'
'vulns'
'sidebar'
'readme';
}
/* Tablet/medium: header/install/vulns full width, readme+sidebar side by side */
@media (min-width: 1024px) {
.package-page {
grid-template-columns: 2fr 1fr;
grid-template-areas:
'header header'
'details details'
'install install'
'vulns vulns'
'readme sidebar';
grid-template-rows: auto auto auto auto 1fr;
}
}
/* Desktop: floating sidebar alongside all content */
@media (min-width: 1280px) {
.package-page {
grid-template-columns: 1fr 20rem;
grid-template-areas:
'header sidebar'
'details sidebar'
'install sidebar'
'vulns sidebar'
'readme sidebar';
}
}
.area-header {
grid-area: header;
}
.area-details {
grid-area: details;
}
.area-install {
grid-area: install;
}
.area-vulns {
grid-area: vulns;
}
.area-readme {
grid-area: readme;
overflow-x: hidden;
}
.area-sidebar {
grid-area: sidebar;
}
/* Sidebar scrollbar: hidden by default, shown on hover/focus */
@media (min-width: 1024px) {
.sidebar-scroll {
scrollbar-gutter: stable;
scrollbar-width: 8px;
scrollbar-color: transparent transparent;
}
.sidebar-scroll::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.sidebar-scroll::-webkit-scrollbar-track,
.sidebar-scroll::-webkit-scrollbar-thumb {
background: transparent;
}
.sidebar-scroll:hover,
.sidebar-scroll:focus-within {
scrollbar-color: var(--border) transparent;
}
.sidebar-scroll:hover::-webkit-scrollbar-thumb,
.sidebar-scroll:focus-within::-webkit-scrollbar-thumb {
background-color: var(--border);
border-radius: 9999px;
}
.sidebar-scroll:hover::-webkit-scrollbar-track,
.sidebar-scroll:focus-within::-webkit-scrollbar-track {
background: transparent;
}
}
</style>