Skip to content

Commit dd33ecc

Browse files
committed
feat: use sticky card
1 parent b3542a1 commit dd33ecc

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

app/pages/package/[[org]]/[name]/versions.vue

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ watch(jumpVersion, () => {
383383
</header>
384384

385385
<!-- Content -->
386-
<div class="max-w-6xl mx-auto py-8 space-y-8">
386+
<div class="container w-full py-8 space-y-8">
387387
<!-- ── Current Tags ───────────────────────────────────────────────────── -->
388388
<section class="space-y-3">
389389
<h2 class="text-xs text-fg-subtle uppercase tracking-wider px-4 sm:px-6 ps-1">
@@ -495,7 +495,7 @@ watch(jumpVersion, () => {
495495
</h2>
496496

497497
<!-- List + changelog side panel -->
498-
<div class="flex items-start">
498+
<div class="flex">
499499
<!-- Version list -->
500500
<div
501501
class="flex-1 min-w-0 border-y sm:border border-border sm:rounded-lg sm:overflow-hidden"
@@ -544,7 +544,8 @@ watch(jumpVersion, () => {
544544
</div>
545545

546546
<!-- Right side -->
547-
<div class="flex items-center gap-3 shrink-0 relative z-10">
547+
<div class="flex items-center gap-2 shrink-0 relative z-10">
548+
<!-- Metadata: date + provenance -->
548549
<DateTime
549550
v-if="v.time"
550551
:datetime="v.time"
@@ -560,24 +561,29 @@ watch(jumpVersion, () => {
560561
compact
561562
:linked="false"
562563
/>
564+
565+
<!-- Divider -->
566+
<span
567+
v-if="v.hasChangelog"
568+
class="w-px h-3.5 bg-border shrink-0 hidden sm:block"
569+
aria-hidden="true"
570+
/>
571+
572+
<!-- Changelog toggle button -->
563573
<button
564574
v-if="v.hasChangelog"
565575
type="button"
566-
class="flex items-center gap-1 text-xs transition-colors rounded focus-visible:outline-accent/70"
576+
class="flex items-center gap-1.5 text-xs px-2 py-1 rounded border transition-colors focus-visible:outline-accent/70"
567577
:class="
568578
selectedChangelogVersion === v.version
569-
? 'text-fg'
570-
: 'text-fg-subtle hover:text-fg'
579+
? 'border-accent/50 bg-accent/8 text-accent'
580+
: 'border-border text-fg-subtle hover:text-fg hover:border-border-hover'
571581
"
572582
:aria-expanded="selectedChangelogVersion === v.version"
573-
:aria-pressed="selectedChangelogVersion === v.version"
583+
:aria-label="`Toggle changelog for v${v.version}`"
574584
@click.stop="toggleChangelog(v.version)"
575585
>
576-
<span
577-
class="i-lucide:chevron-right w-3 h-3 transition-transform duration-200 motion-reduce:transition-none"
578-
:class="{ 'rotate-90': selectedChangelogVersion === v.version }"
579-
aria-hidden="true"
580-
/>
586+
<span class="i-lucide:scroll-text w-3.5 h-3.5 shrink-0" aria-hidden="true" />
581587
<span class="hidden sm:inline">Changelog</span>
582588
</button>
583589
</div>
@@ -603,11 +609,11 @@ watch(jumpVersion, () => {
603609

604610
<!-- Changelog side panel (desktop only) -->
605611
<div
606-
class="hidden sm:block overflow-hidden shrink-0 transition-[width] duration-200 ease-out motion-reduce:transition-none"
612+
class="hidden sm:block overflow-clip shrink-0 transition-[width] duration-200 ease-out motion-reduce:transition-none"
607613
:class="selectedChangelogVersion ? 'w-[28rem] ms-6' : 'w-0'"
608614
>
609615
<!-- Fixed-width inner keeps content from squishing during animation -->
610-
<div class="w-[28rem] sticky top-28">
616+
<div class="w-[28rem] sticky top-34">
611617
<div class="rounded-lg border border-border overflow-hidden">
612618
<!-- Panel header -->
613619
<div

0 commit comments

Comments
 (0)