Skip to content

Commit 88509be

Browse files
authored
feat: add RTL support to PackageCard (#336)
1 parent 843e168 commit 88509be

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

app/components/PackageCard.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const emit = defineEmits<{
4040
class="absolute -inset-px rounded-lg bg-gradient-to-r from-accent/0 via-accent/20 to-accent/0 opacity-100 blur-sm -z-1 pointer-events-none motion-reduce:opacity-50"
4141
aria-hidden="true"
4242
/>
43-
<div class="mb-2 flex items-baseline justify-between gap-2">
43+
<div class="mb-2 flex items-baseline justify-start gap-2">
4444
<component
4545
:is="headingLevel ?? 'h3'"
4646
class="font-mono text-sm sm:text-base font-medium text-fg group-hover:text-fg transition-colors duration-200 min-w-0 break-all"
@@ -56,10 +56,11 @@ const emit = defineEmits<{
5656
>
5757
<span
5858
v-if="isExactMatch"
59-
class="text-xs px-1.5 py-0.5 ml-2 rounded bg-bg-elevated border border-border-hover text-fg"
59+
class="text-xs px-1.5 py-0.5 ms-2 rounded bg-bg-elevated border border-border-hover text-fg"
6060
>{{ $t('search.exact_match') }}</span
6161
>
6262
</component>
63+
<span aria-hidden="true" class="flex-shrink-1 flex-grow-1" />
6364
<!-- Mobile: version next to package name -->
6465
<div class="sm:hidden text-fg-subtle flex items-center gap-1.5 shrink-0">
6566
<span
@@ -79,7 +80,7 @@ const emit = defineEmits<{
7980
/>
8081
</div>
8182
</div>
82-
<div class="flex justify-between items-start gap-4 sm:gap-8">
83+
<div class="flex justify-start items-start gap-4 sm:gap-8">
8384
<div class="min-w-0">
8485
<p
8586
v-if="result.package.description"
@@ -121,12 +122,13 @@ const emit = defineEmits<{
121122
<div class="flex items-center gap-1.5">
122123
<dt class="sr-only">{{ $t('package.card.weekly_downloads') }}</dt>
123124
<dd class="flex items-center gap-1.5">
124-
<span class="i-carbon-chart-line w-3.5 h-3.5 inline-block" aria-hidden="true" />
125+
<span class="i-carbon:chart-line w-3.5 h-3.5 inline-block" aria-hidden="true" />
125126
<span class="font-mono">{{ formatNumber(result.downloads.weekly) }}/w</span>
126127
</dd>
127128
</div>
128129
</dl>
129130
</div>
131+
<span aria-hidden="true" class="flex-shrink-1 flex-grow-1" />
130132
<!-- Desktop: version and downloads on right side -->
131133
<div class="hidden sm:flex flex-col gap-2 shrink-0">
132134
<div class="text-fg-subtle flex items-start gap-2 justify-end">
@@ -154,7 +156,7 @@ const emit = defineEmits<{
154156
v-if="result.downloads?.weekly"
155157
class="text-fg-subtle gap-2 flex items-center justify-end"
156158
>
157-
<span class="i-carbon-chart-line w-3.5 h-3.5 inline-block" aria-hidden="true" />
159+
<span class="i-carbon:chart-line w-3.5 h-3.5 inline-block" aria-hidden="true" />
158160
<span class="font-mono text-xs">
159161
{{ formatNumber(result.downloads.weekly) }} {{ $t('common.per_week') }}
160162
</span>

0 commit comments

Comments
 (0)