Skip to content

Commit 037638a

Browse files
committed
chore: move link to own folder
1 parent 83ae495 commit 037638a

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

app/components/Package/Keywords.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ defineProps<{
77
<CollapsibleSection v-if="keywords?.length" :title="$t('package.keywords_title')" id="keywords">
88
<ul class="flex flex-wrap gap-1.5 list-none m-0 p-0">
99
<li v-for="keyword in keywords.slice(0, 15)" :key="keyword">
10-
<ButtonLink variant="tag" :to="{ name: 'search', query: { q: `keywords:${keyword}` } }">
10+
<LinkBase variant="tag" :to="{ name: 'search', query: { q: `keywords:${keyword}` } }">
1111
{{ keyword }}
12-
</ButtonLink>
12+
</LinkBase>
1313
</li>
1414
</ul>
1515
</CollapsibleSection>

app/components/Package/MetricsBadges.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ButtonLink, TagStatic } from '#components'
2+
import { LinkBase, TagStatic } from '#components'
33
44
const props = defineProps<{
55
packageName: string
@@ -56,10 +56,10 @@ const typesHref = computed(() => {
5656
<!-- TypeScript types badge -->
5757
<li v-if="!props.isBinary">
5858
<TooltipApp :text="typesTooltip">
59-
<ButtonLink v-if="typesHref" variant="tag" :to="typesHref">
59+
<LinkBase v-if="typesHref" variant="tag" :to="typesHref">
6060
<span class="w-3 h-3 i-carbon-checkmark" aria-hidden="true" />
6161
{{ $t('package.metrics.types_label') }}
62-
</ButtonLink>
62+
</LinkBase>
6363
<TagStatic v-else :variant="hasTypes ? 'default' : 'disabled'" :tabindex="0">
6464
<span
6565
class="w-3 h-3"

app/pages/@[org].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ defineOgImageComponent('Default', {
234234
<p class="text-fg-muted mb-4">
235235
{{ error?.message ?? $t('org.page.failed_to_load') }}
236236
</p>
237-
<ButtonLink to="/">{{ $t('common.go_back_home') }}</ButtonLink>
237+
<LinkBase to="/">{{ $t('common.go_back_home') }}</LinkBase>
238238
</div>
239239

240240
<!-- Empty state -->

app/pages/package-code/[...path].vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ defineOgImageComponent('Default', {
359359
<!-- Error: no version -->
360360
<div v-if="!version" class="container py-20 text-center">
361361
<p class="text-fg-muted mb-4">{{ $t('code.version_required') }}</p>
362-
<ButtonLink :to="packageRoute()">{{ $t('code.go_to_package') }}</ButtonLink>
362+
<LinkBase :to="packageRoute()">{{ $t('code.go_to_package') }}</LinkBase>
363363
</div>
364364

365365
<!-- Loading state -->
@@ -371,7 +371,7 @@ defineOgImageComponent('Default', {
371371
<!-- Error state -->
372372
<div v-else-if="treeStatus === 'error'" class="container py-20 text-center" role="alert">
373373
<p class="text-fg-muted mb-4">{{ $t('code.failed_to_load_tree') }}</p>
374-
<ButtonLink :to="packageRoute(version)">{{ $t('code.back_to_package') }}</ButtonLink>
374+
<LinkBase :to="packageRoute(version)">{{ $t('code.back_to_package') }}</LinkBase>
375375
</div>
376376

377377
<!-- Main content: file tree + file viewer -->
@@ -472,15 +472,15 @@ defineOgImageComponent('Default', {
472472
<p class="text-fg-subtle text-sm mb-4">
473473
{{ $t('code.file_size_warning', { size: formatBytes(currentNode?.size ?? 0) }) }}
474474
</p>
475-
<ButtonLink
475+
<LinkBase
476476
:href="`https://cdn.jsdelivr.net/npm/${packageName}@${version}/${filePath}`"
477477
target="_blank"
478478
rel="noopener noreferrer"
479479
class="inline-flex items-center gap-2"
480480
>
481481
{{ $t('code.view_raw') }}
482482
<span class="i-carbon:launch w-4 h-4" />
483-
</ButtonLink>
483+
</LinkBase>
484484
</div>
485485

486486
<!-- Loading file content -->
@@ -526,15 +526,15 @@ defineOgImageComponent('Default', {
526526
<div class="i-carbon:warning-alt w-8 h-8 mx-auto text-fg-subtle mb-4" />
527527
<p class="text-fg-muted mb-2">{{ $t('code.failed_to_load') }}</p>
528528
<p class="text-fg-subtle text-sm mb-4">{{ $t('code.unavailable_hint') }}</p>
529-
<ButtonLink
529+
<LinkBase
530530
:href="`https://cdn.jsdelivr.net/npm/${packageName}@${version}/${filePath}`"
531531
target="_blank"
532532
rel="noopener noreferrer"
533533
class="inline-flex items-center gap-2"
534534
>
535535
{{ $t('code.view_raw') }}
536536
<span class="i-carbon:launch w-4 h-4" />
537-
</ButtonLink>
537+
</LinkBase>
538538
</div>
539539

540540
<!-- Directory listing (when no file selected or viewing a directory) -->

app/pages/package/[...package].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ defineOgImageComponent('Package', {
11511151
<p class="text-fg-muted mb-8">
11521152
{{ error?.message ?? $t('package.not_found_message') }}
11531153
</p>
1154-
<ButtonLink to="/">{{ $t('common.go_back_home') }}</ButtonLink>
1154+
<LinkBase to="/">{{ $t('common.go_back_home') }}</LinkBase>
11551155
</div>
11561156
</main>
11571157
</template>

app/pages/~[username]/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ defineOgImageComponent('Default', {
224224
<p class="text-fg-muted mb-4">
225225
{{ error?.message ?? $t('user.page.failed_to_load') }}
226226
</p>
227-
<ButtonLink to="/">{{ $t('common.go_back_home') }}</ButtonLink>
227+
<LinkBase to="/">{{ $t('common.go_back_home') }}</LinkBase>
228228
</div>
229229

230230
<!-- Package list -->

app/pages/~[username]/orgs.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ defineOgImageComponent('Default', {
156156
<!-- Not own profile state -->
157157
<div v-else-if="!isOwnProfile" class="py-12 text-center">
158158
<p class="text-fg-muted">{{ $t('user.orgs_page.own_orgs_only') }}</p>
159-
<ButtonLink :to="`/~${npmUser}/orgs`" class="mt-4">{{
159+
<LinkBase :to="`/~${npmUser}/orgs`" class="mt-4">{{
160160
$t('user.orgs_page.view_your_orgs')
161-
}}</ButtonLink>
161+
}}</LinkBase>
162162
</div>
163163

164164
<!-- Loading state -->

test/nuxt/a11y.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import {
6464
BaseCard,
6565
BuildEnvironment,
6666
ButtonBase,
67-
ButtonLink,
67+
LinkBase,
6868
CallToAction,
6969
CodeDirectoryListing,
7070
CodeFileTree,
@@ -331,9 +331,9 @@ describe('component accessibility audits', () => {
331331
})
332332
})
333333

334-
describe('ButtonLink', () => {
334+
describe('LinkBase', () => {
335335
it('should have no accessibility violations', async () => {
336-
const component = await mountSuspended(ButtonLink, {
336+
const component = await mountSuspended(LinkBase, {
337337
props: { href: 'http://example.com' },
338338
slots: { default: 'Button link content' },
339339
})
@@ -342,7 +342,7 @@ describe('component accessibility audits', () => {
342342
})
343343

344344
it("should have no accessibility violations when it's the current link", async () => {
345-
const component = await mountSuspended(ButtonLink, {
345+
const component = await mountSuspended(LinkBase, {
346346
props: { href: 'http://example.com', current: true },
347347
slots: { default: 'Button link content' },
348348
})
@@ -351,7 +351,7 @@ describe('component accessibility audits', () => {
351351
})
352352

353353
it('should have no accessibility violations when disabled (plain text)', async () => {
354-
const component = await mountSuspended(ButtonLink, {
354+
const component = await mountSuspended(LinkBase, {
355355
props: { href: 'http://example.com', disabled: true },
356356
slots: { default: 'Button link content' },
357357
})

0 commit comments

Comments
 (0)