-
-
Notifications
You must be signed in to change notification settings - Fork 432
Expand file tree
/
Copy pathSkeleton.vue
More file actions
365 lines (333 loc) · 12 KB
/
Skeleton.vue
File metadata and controls
365 lines (333 loc) · 12 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
<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>
<!-- Metrics badges -->
<div class="basis-full 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>
<!-- Internal navigation 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-16 rounded" />
<SkeletonInline class="h-7 w-14 rounded" />
<SkeletonInline class="h-7 w-20 rounded" />
</div>
</div>
</header>
<!-- Package details — matches area-details in [...name].vue -->
<section class="area-details">
<div class="mb-4">
<!-- Description container with min-height to prevent CLS -->
<div class="max-w-2xl min-h-[4.5rem]">
<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">
<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 text-fg-subtle uppercase tracking-wider">
{{ $t('package.get_started.title') }}
</h2>
<!-- Package manager select placeholder -->
<SkeletonInline class="h-7 w-24 rounded" />
</div>
<!-- Install command code block -->
<div class="relative">
<div
class="bg-bg-muted border border-border rounded-md p-4 font-mono text-sm overflow-x-auto pe-16"
>
<SkeletonInline class="h-5 w-52" />
</div>
<SkeletonInline class="absolute top-3 inset-ie-3 h-6 w-12 rounded" />
</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 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="sidebar-scroll sticky top-34 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:(top-22 pt-2 max-h-[calc(100dvh-6rem)])"
>
<!-- Download stats -->
<section>
<h2 class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
{{ $t('package.skeleton.weekly') }}
</h2>
<!-- Chart placeholder -->
<SkeletonBlock class="h-32 w-full rounded-lg" />
</section>
<!-- Versions -->
<section>
<h2 class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
{{ $t('package.skeleton.versions') }}
</h2>
<div class="space-y-1">
<div class="flex items-center justify-between py-1.5 text-sm">
<SkeletonInline class="h-4 w-16" />
<SkeletonInline class="h-4 w-24" />
</div>
<div class="flex items-center justify-between py-1.5 text-sm">
<SkeletonInline class="h-4 w-14" />
<SkeletonInline class="h-4 w-24" />
</div>
<div class="flex items-center justify-between py-1.5 text-sm">
<SkeletonInline class="h-4 w-18" />
<SkeletonInline class="h-4 w-24" />
</div>
<div class="flex items-center justify-between py-1.5 text-sm">
<SkeletonInline class="h-4 w-14" />
<SkeletonInline class="h-4 w-24" />
</div>
<div class="flex items-center justify-between py-1.5 text-sm">
<SkeletonInline class="h-4 w-16" />
<SkeletonInline class="h-4 w-24" />
</div>
</div>
</section>
<!-- Dependencies -->
<section>
<h2 class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
{{ $t('package.skeleton.dependencies') }}
</h2>
<ul class="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 -->
<section>
<h2 class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
{{ $t('package.skeleton.keywords') }}
</h2>
<ul class="flex flex-wrap gap-1.5 list-none m-0 p-0">
<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 -->
<section>
<h2 class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
{{ $t('package.skeleton.maintainers') }}
</h2>
<ul class="space-y-2 list-none m-0 p-0">
<li><SkeletonInline class="h-5 w-28" /></li>
<li><SkeletonInline class="h-5 w-24" /></li>
</ul>
</section>
</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>