|
1 | 1 | <script setup lang="ts"></script> |
2 | 2 |
|
3 | 3 | <template> |
| 4 | + <!-- Package header — matches area-header in [...name].vue --> |
| 5 | + <header class="bg-[--bg] pt-2"> |
| 6 | + <div class="min-w-0"> |
| 7 | + <!-- Package name --> |
| 8 | + <div class="min-w-0 flex items-center gap-2 justify-between"> |
| 9 | + <h1 class="font-mono text-2xl sm:text-3xl font-medium"> |
| 10 | + <SkeletonInline class="block! h-9 w-48" /> |
| 11 | + </h1> |
| 12 | + <div class="flex gap-1"> |
| 13 | + <!-- Compare placeholder --> |
| 14 | + <SkeletonBlock class="w-9 md:w-40 h-9 rounded self-baseline" /> |
| 15 | + <!-- Likes button placeholder --> |
| 16 | + <SkeletonBlock class="w-14 h-9 rounded self-baseline" /> |
| 17 | + </div> |
| 18 | + </div> |
| 19 | + </div> |
| 20 | + </header> |
| 21 | + |
| 22 | + <div |
| 23 | + class="sticky top-14 z-1 pt-2 bg-bg border-b border-border flex flex-col md:flex-row-reverse flex-wrap gap-2 justify-between" |
| 24 | + > |
| 25 | + <!-- Version --> |
| 26 | + <span class="inline-flex items-baseline font-mono text-base sm:text-lg shrink-0"> |
| 27 | + <SkeletonInline class="h-6 w-20" /> |
| 28 | + </span> |
| 29 | + <!-- Docs + Code + Compare nav placeholder (hidden on mobile) --> |
| 30 | + <div class="flex items-center gap-0.5 p-0.5"> |
| 31 | + <SkeletonInline class="h-7 w-22 rounded" /> |
| 32 | + <SkeletonInline class="h-7 w-20 rounded" /> |
| 33 | + <SkeletonInline class="h-7 w-26 rounded" /> |
| 34 | + </div> |
| 35 | + </div> |
4 | 36 | <article |
5 | 37 | aria-busy="true" |
6 | 38 | :aria-label="$t('package.skeleton.loading')" |
7 | 39 | class="package-page motion-safe:animate-fade-in" |
8 | 40 | > |
9 | | - <!-- Package header — matches area-header in [...name].vue --> |
10 | | - <header class="area-header sticky top-14 z-1 bg-[--bg] py-2"> |
11 | | - <div class="flex items-baseline gap-x-2 gap-y-1 sm:gap-x-3 flex-wrap min-w-0"> |
12 | | - <!-- Package name --> |
13 | | - <div class="min-w-0"> |
14 | | - <h1 class="font-mono text-2xl sm:text-3xl font-medium"> |
15 | | - <SkeletonInline class="h-9 w-48" /> |
16 | | - </h1> |
17 | | - </div> |
18 | | - <!-- Version --> |
19 | | - <span class="inline-flex items-baseline font-mono text-base sm:text-lg shrink-0"> |
20 | | - <SkeletonInline class="h-6 w-20" /> |
21 | | - </span> |
22 | | - |
23 | | - <!-- Docs + Code + Compare nav placeholder (hidden on mobile) --> |
24 | | - <div |
25 | | - 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" |
26 | | - > |
27 | | - <SkeletonInline class="h-7 w-22 rounded" /> |
28 | | - <SkeletonInline class="h-7 w-20 rounded" /> |
29 | | - <SkeletonInline class="h-7 w-26 rounded" /> |
30 | | - </div> |
31 | | - |
32 | | - <!-- Metrics badges + likes — matches basis-full flex row --> |
33 | | - <div class="basis-full flex gap-2 sm:gap-3 flex-wrap items-stretch"> |
34 | | - <!-- Badge row (Types, ESM, CJS, CJS-ghost) --> |
35 | | - <div class="flex items-center gap-1.5 self-baseline"> |
36 | | - <SkeletonBlock class="w-16 h-5.5 rounded" /> |
37 | | - <SkeletonBlock class="w-13 h-5.5 rounded" /> |
38 | | - <SkeletonBlock class="w-13 h-5.5 rounded" /> |
39 | | - <SkeletonBlock class="w-13 h-5.5 rounded bg-bg-subtle" /> |
40 | | - </div> |
41 | | - <!-- Likes button placeholder --> |
42 | | - <SkeletonBlock class="w-14 h-5.5 rounded self-baseline" /> |
43 | | - </div> |
44 | | - </div> |
45 | | - </header> |
46 | | - |
47 | 41 | <!-- Package details — matches area-details in [...name].vue --> |
48 | | - <section class="area-details"> |
| 42 | + <section class="area-details pt-4"> |
49 | 43 | <div class="mb-4"> |
50 | 44 | <!-- Description --> |
51 | 45 | <div class="max-w-2xl"> |
|
65 | 59 | <li><SkeletonInline class="h-5 w-16" /></li> |
66 | 60 | <li><SkeletonInline class="h-5 w-10" /></li> |
67 | 61 | </ul> |
| 62 | + |
| 63 | + <!-- Metrics badges + likes — matches basis-full flex row --> |
| 64 | + <div class="basis-full flex gap-2 sm:gap-3 flex-wrap items-stretch mt-4"> |
| 65 | + <!-- Badge row (Types, ESM, CJS, CJS-ghost) --> |
| 66 | + <div class="flex items-center gap-1.5 self-baseline"> |
| 67 | + <SkeletonBlock class="w-16 h-5.5 rounded" /> |
| 68 | + <SkeletonBlock class="w-13 h-5.5 rounded" /> |
| 69 | + <SkeletonBlock class="w-13 h-5.5 rounded" /> |
| 70 | + <SkeletonBlock class="w-13 h-5.5 rounded bg-bg-subtle" /> |
| 71 | + </div> |
| 72 | + </div> |
68 | 73 | </div> |
69 | 74 |
|
70 | 75 | <!-- Stats grid — matches dl in [...name].vue --> |
|
382 | 387 | /* Mobile: single column, sidebar above readme */ |
383 | 388 | grid-template-columns: minmax(0, 1fr); |
384 | 389 | grid-template-areas: |
385 | | - 'header' |
386 | 390 | 'details' |
387 | 391 | 'install' |
388 | 392 | 'vulns' |
389 | 393 | 'sidebar' |
390 | 394 | 'readme'; |
391 | 395 | } |
392 | 396 |
|
393 | | -/* Tablet/medium: header/install/vulns full width, readme+sidebar side by side */ |
| 397 | +/* Tablet/medium: install/vulns full width, readme+sidebar side by side */ |
394 | 398 | @media (min-width: 1024px) { |
395 | 399 | .package-page { |
396 | 400 | grid-template-columns: 2fr 1fr; |
397 | 401 | grid-template-areas: |
398 | | - 'header header' |
399 | 402 | 'details details' |
400 | 403 | 'install install' |
401 | 404 | 'vulns vulns' |
|
409 | 412 | .package-page { |
410 | 413 | grid-template-columns: 1fr 20rem; |
411 | 414 | grid-template-areas: |
412 | | - 'header sidebar' |
413 | 415 | 'details sidebar' |
414 | 416 | 'install sidebar' |
415 | 417 | 'vulns sidebar' |
416 | 418 | 'readme sidebar'; |
417 | 419 | } |
418 | 420 | } |
419 | 421 |
|
420 | | -.area-header { |
421 | | - grid-area: header; |
422 | | -} |
423 | | -
|
424 | 422 | .area-details { |
425 | 423 | grid-area: details; |
426 | 424 | } |
|
0 commit comments