Skip to content

Commit caeb263

Browse files
committed
fix: more focus rings, standardise button size and address clipping issues
1 parent 2408e8c commit caeb263

8 files changed

Lines changed: 18 additions & 18 deletions

File tree

app/components/CollapsibleSection.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,17 @@ useHead({
118118
</component>
119119

120120
<!-- Actions slot for buttons or other elements -->
121-
<slot name="actions" />
121+
<div class="pe-1">
122+
<slot name="actions" />
123+
</div>
122124
</div>
123125

124126
<div
125127
:id="contentId"
126128
class="grid ms-6 transition-[grid-template-rows] duration-200 ease-in-out collapsible-content overflow-hidden"
129+
:inert="!isOpen"
127130
>
128-
<div class="min-h-0 min-w-0">
131+
<div class="min-h-0 min-w-0 p-1">
129132
<slot />
130133
</div>
131134
</div>

app/components/Package/Dependencies.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const sortedOptionalDependencies = computed(() => {
7575
id="dependencies"
7676
:title="$t('package.dependencies.title', { count: sortedDependencies.length })"
7777
>
78-
<ul class="space-y-1 list-none m-0 px-1" :aria-label="$t('package.dependencies.list_label')">
78+
<ul class="space-y-1 list-none m-0" :aria-label="$t('package.dependencies.list_label')">
7979
<li
8080
v-for="[dep, version] in sortedDependencies.slice(0, depsExpanded ? undefined : 10)"
8181
:key="dep"
@@ -166,10 +166,7 @@ const sortedOptionalDependencies = computed(() => {
166166
})
167167
"
168168
>
169-
<ul
170-
class="space-y-1 list-none m-0 p-0"
171-
:aria-label="$t('package.peer_dependencies.list_label')"
172-
>
169+
<ul class="space-y-1 list-none m-0" :aria-label="$t('package.peer_dependencies.list_label')">
173170
<li
174171
v-for="peer in sortedPeerDependencies.slice(0, peerDepsExpanded ? undefined : 10)"
175172
:key="peer.name"
@@ -230,7 +227,7 @@ const sortedOptionalDependencies = computed(() => {
230227
"
231228
>
232229
<ul
233-
class="space-y-1 list-none m-0 p-0"
230+
class="space-y-1 list-none m-0"
234231
:aria-label="$t('package.optional_dependencies.list_label')"
235232
>
236233
<li

app/components/Package/InstallScripts.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const isExpanded = shallowRef(false)
3131
<dt class="font-mono text-xs text-fg-muted">{{ scriptName }}</dt>
3232
<dd
3333
tabindex="0"
34-
class="font-mono text-sm text-fg-subtle m-0 truncate focus:whitespace-normal focus:overflow-visible cursor-help rounded focus-visible:outline-accent/70"
34+
class="font-mono text-sm text-fg-subtle m-0 truncate focus:whitespace-normal focus:overflow-visible cursor-help rounded focus-visible:(outline-2 outline-accent outline-offset-2)"
3535
:title="installScripts.content?.[scriptName]"
3636
>
3737
{{ installScripts.content?.[scriptName] || $t('package.install_scripts.script_label') }}

app/components/Package/Playgrounds.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function focusMenuItem(index: number) {
109109
</script>
110110

111111
<template>
112-
<section v-if="links.length > 0">
112+
<section v-if="links.length > 0" class="px-1">
113113
<h2 id="playgrounds-heading" class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
114114
{{ $t('package.playgrounds.title') }}
115115
</h2>
@@ -121,7 +121,7 @@ function focusMenuItem(index: number) {
121121
:href="firstLink.url"
122122
target="_blank"
123123
rel="noopener noreferrer"
124-
class="w-full flex items-center gap-2 px-3 py-2 text-sm font-mono bg-bg-muted border border-border rounded-md hover:border-border-hover hover:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-hover transition-colors duration-200"
124+
class="w-full flex items-center gap-2 px-3 py-2 text-sm font-mono bg-bg-muted border border-border rounded-md hover:border-border-hover hover:bg-bg-elevated focus-visible:outline-accent/70 transition-colors duration-200"
125125
>
126126
<span
127127
:class="[getIcon(firstLink.provider), getColor(firstLink.provider), 'w-4 h-4 shrink-0']"
@@ -137,7 +137,7 @@ function focusMenuItem(index: number) {
137137
type="button"
138138
aria-haspopup="true"
139139
:aria-expanded="isOpen"
140-
class="w-full flex items-center justify-between gap-2 px-3 py-2 text-sm font-mono bg-bg-muted border border-border rounded-md hover:border-border-hover hover:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-hover transition-colors duration-200"
140+
class="w-full flex items-center justify-between gap-2 px-3 py-2 text-sm font-mono bg-bg-muted border border-border rounded-md hover:border-border-hover hover:bg-bg-elevated focus-visible:outline-accent/70 transition-colors duration-200"
141141
@click="isOpen = !isOpen"
142142
@keydown="handleKeydown"
143143
>
@@ -176,7 +176,7 @@ function focusMenuItem(index: number) {
176176
target="_blank"
177177
rel="noopener noreferrer"
178178
role="menuitem"
179-
class="flex items-center gap-2 px-3 py-2 text-sm font-mono text-fg-muted hover:text-fg hover:bg-bg-muted focus-visible:outline-none focus-visible:text-fg focus-visible:bg-bg-muted transition-colors duration-150"
179+
class="flex items-center gap-2 px-3 py-2 text-sm font-mono text-fg-muted hover:text-fg hover:bg-bg-muted focus-visible:outline-accent/70 focus-visible:text-fg focus-visible:bg-bg-muted transition-colors duration-150"
180180
@click="closeDropdown"
181181
>
182182
<span

app/components/Package/SkillsCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const skillsModal = useModal('skills-modal')
1414
<CollapsibleSection v-if="skills.length" :title="$t('package.skills.title')" id="skills">
1515
<button
1616
type="button"
17-
class="w-full flex items-center gap-2 px-3 py-2 text-sm font-mono bg-bg-muted border border-border rounded-md hover:border-border-hover hover:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-hover transition-colors duration-200"
17+
class="w-full flex items-center gap-2 px-3 py-2 text-sm font-mono bg-bg-muted border border-border rounded-md hover:border-border-hover hover:bg-bg-elevated focus-visible:outline-accent/70 transition-colors duration-200"
1818
@click="skillsModal.open()"
1919
>
2020
<span class="i-custom:agent-skills w-4 h-4 shrink-0 text-fg-muted" aria-hidden="true" />

app/components/Package/Versions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
311311
:href="`https://majors.nullvoxpopuli.com/q?packages=${packageName}`"
312312
target="_blank"
313313
rel="noopener noreferrer"
314-
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1"
314+
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1 focus-visible:outline-accent/70 rounded"
315315
:title="$t('package.downloads.community_distribution')"
316316
>
317317
<span class="i-carbon:load-balancer-network w-3.5 h-3.5" aria-hidden="true" />

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const config = computed(() => {
202202
<button
203203
type="button"
204204
@click="openChartModal"
205-
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5 ms-auto shrink-0 self-center focus-visible:outline-accent/70 rounded"
205+
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1 focus-visible:outline-accent/70 rounded"
206206
:title="$t('package.downloads.analyze')"
207207
>
208208
<span class="i-carbon:data-analytics w-4 h-4" aria-hidden="true" />

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ defineOgImageComponent('Package', {
838838
:href="`https://npmgraph.js.org/?q=${pkg.name}`"
839839
target="_blank"
840840
rel="noopener noreferrer"
841-
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1"
841+
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1 focus-visible:outline-accent/70 rounded"
842842
:title="$t('package.stats.view_dependency_graph')"
843843
>
844844
<span class="i-carbon:network-3 w-3.5 h-3.5" aria-hidden="true" />
@@ -850,7 +850,7 @@ defineOgImageComponent('Package', {
850850
:href="`https://node-modules.dev/grid/depth#install=${pkg.name}${resolvedVersion ? `@${resolvedVersion}` : ''}`"
851851
target="_blank"
852852
rel="noopener noreferrer"
853-
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1"
853+
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1 focus-visible:outline-accent/70 rounded"
854854
:title="$t('package.stats.inspect_dependency_tree')"
855855
>
856856
<span class="i-lucide-view w-3.5 h-3.5" aria-hidden="true" />

0 commit comments

Comments
 (0)