Skip to content

Commit cefc172

Browse files
alexdlnbrenoepics
andauthored
fix: polish versions layout (#621)
Co-authored-by: brenoepics <git@breno.tech>
1 parent 88b8e90 commit cefc172

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

app/components/PackageDependencies.vue

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ const sortedOptionalDependencies = computed(() => {
7979
<li
8080
v-for="[dep, version] in sortedDependencies.slice(0, depsExpanded ? undefined : 10)"
8181
:key="dep"
82-
class="flex items-center justify-start py-1 text-sm gap-2"
82+
class="flex items-center justify-between py-1 text-sm gap-2"
8383
>
8484
<NuxtLink
8585
:to="{ name: 'package', params: { package: dep.split('/') } }"
86-
class="font-mono text-fg-muted hover:text-fg transition-colors duration-200 truncate min-w-0"
86+
class="font-mono text-fg-muted hover:text-fg transition-colors duration-200 truncate min-w-0 flex-1"
8787
>
8888
{{ dep }}
8989
</NuxtLink>
90-
<span class="flex items-center gap-1">
90+
<span class="flex items-center gap-1 max-w-[40%]">
9191
<span
9292
v-if="outdatedDeps[dep]"
9393
class="shrink-0"
@@ -97,7 +97,6 @@ const sortedOptionalDependencies = computed(() => {
9797
>
9898
<span class="i-carbon:warning-alt w-3 h-3 block" />
9999
</span>
100-
<span aria-hidden="true" class="flex-shrink-1 flex-grow-1" />
101100
<NuxtLink
102101
v-if="getVulnerableDepInfo(dep)"
103102
:to="{
@@ -174,9 +173,9 @@ const sortedOptionalDependencies = computed(() => {
174173
<li
175174
v-for="peer in sortedPeerDependencies.slice(0, peerDepsExpanded ? undefined : 10)"
176175
:key="peer.name"
177-
class="flex items-center justify-start py-1 text-sm gap-2"
176+
class="flex items-center justify-between py-1 text-sm gap-1 min-w-0"
178177
>
179-
<div class="flex items-center gap-2 min-w-0">
178+
<div class="flex items-center gap-1 min-w-0 flex-1">
180179
<NuxtLink
181180
:to="{
182181
name: 'package',
@@ -194,13 +193,12 @@ const sortedOptionalDependencies = computed(() => {
194193
{{ $t('package.dependencies.optional') }}
195194
</span>
196195
</div>
197-
<span aria-hidden="true" class="flex-shrink-1 flex-grow-1" />
198196
<NuxtLink
199197
:to="{
200198
name: 'package',
201199
params: { package: [...peer.name.split('/'), 'v', peer.version] },
202200
}"
203-
class="font-mono text-xs text-fg-subtle max-w-[40%] text-end truncate"
201+
class="font-mono text-xs text-fg-subtle max-w-[40%] truncate"
204202
:title="peer.version"
205203
>
206204
{{ peer.version }}
@@ -241,21 +239,20 @@ const sortedOptionalDependencies = computed(() => {
241239
optionalDepsExpanded ? undefined : 10,
242240
)"
243241
:key="dep"
244-
class="flex items-center justify-start py-1 text-sm gap-2"
242+
class="flex items-center justify-between py-1 text-sm gap-2"
245243
>
246244
<NuxtLink
247245
:to="{ name: 'package', params: { package: dep.split('/') } }"
248-
class="font-mono text-fg-muted hover:text-fg transition-colors duration-200 truncate min-w-0"
246+
class="font-mono text-fg-muted hover:text-fg transition-colors duration-200 truncate min-w-0 flex-1"
249247
>
250248
{{ dep }}
251249
</NuxtLink>
252-
<span aria-hidden="true" class="flex-shrink-1 flex-grow-1" />
253250
<NuxtLink
254251
:to="{
255252
name: 'package',
256253
params: { package: [...dep.split('/'), 'v', version] },
257254
}"
258-
class="font-mono text-xs text-fg-subtle max-w-[50%] text-end truncate"
255+
class="font-mono text-xs text-fg-subtle max-w-[40%] text-end truncate"
259256
:title="version"
260257
>
261258
{{ version }}

0 commit comments

Comments
 (0)