Skip to content

Commit 8314370

Browse files
committed
chore: add JSRequired component
1 parent e977ff4 commit 8314370

File tree

6 files changed

+20
-1
lines changed

6 files changed

+20
-1
lines changed

app/components/JSRequired.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template>
2+
<noscript>
3+
<div
4+
class="mb-8 px-4 py-3 border rounded-lg border-red-700 bg-red-50 text-red-800 dark:border-red-400 dark:bg-red-900/20 dark:text-red-200 text-base"
5+
role="alert"
6+
>
7+
{{ $t('js_required') }}
8+
</div>
9+
</noscript>
10+
</template>

app/pages/compare.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ useSeoMeta({
136136
</p>
137137
</header>
138138

139+
<JSRequired />
140+
139141
<!-- Package selector -->
140142
<section class="mb-8" aria-labelledby="packages-heading">
141143
<h2 id="packages-heading" class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
@@ -304,7 +306,8 @@ useSeoMeta({
304306

305307
<template #fallback>
306308
<!-- Generic loading state for the whole grid section if needed, or rely on inner skeletons -->
307-
<div class="mt-10 space-y-4">
309+
<div class="mt-10 space-y-4" role="status" :aria-label="$t('compare.packages.loading')">
310+
<span class="sr-only">{{ $t('compare.packages.loading') }}</span>
308311
<SkeletonBlock class="w-32 h-4 mb-4" />
309312
<div class="border border-border rounded-lg p-4 space-y-4">
310313
<div class="flex gap-4">

i18n/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"description": "a fast, modern browser for the npm registry. Search, browse, and explore packages with a modern interface."
77
}
88
},
9+
"js_required": "This page requires JavaScript to function.",
910
"built_at": "built {0}",
1011
"alt_logo": "npmx logo",
1112
"tagline": "a fast, modern browser for the npm registry",

i18n/schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
},
2323
"additionalProperties": false
2424
},
25+
"js_required": {
26+
"type": "string"
27+
},
2528
"built_at": {
2629
"type": "string"
2730
},

lunaria/files/en-GB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "a fast, modern browser for the npm registry. Search, browse, and explore packages with a modern interface."
66
}
77
},
8+
"js_required": "This page requires JavaScript to function.",
89
"built_at": "built {0}",
910
"alt_logo": "npmx logo",
1011
"tagline": "a fast, modern browser for the npm registry",

lunaria/files/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "a fast, modern browser for the npm registry. Search, browse, and explore packages with a modern interface."
66
}
77
},
8+
"js_required": "This page requires JavaScript to function.",
89
"built_at": "built {0}",
910
"alt_logo": "npmx logo",
1011
"tagline": "a fast, modern browser for the npm registry",

0 commit comments

Comments
 (0)