Skip to content

Commit d48654a

Browse files
committed
Merge branch 'main' into feat/changelog-1
1 parent f9c0736 commit d48654a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2781
-350
lines changed

.github/workflows/chromatic.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
chromatic:
1818
name: 📚 Chromatic
1919
runs-on: ubuntu-24.04-arm
20-
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
2120

2221
steps:
2322
- name: ☑️ Checkout
2423
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2524
with:
2625
fetch-depth: 0
27-
ref: ${{ github.event.pull_request.head.ref || github.ref }}
26+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
27+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
2828

2929
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
3030
with:
@@ -38,10 +38,8 @@ jobs:
3838
- name: 📦 Install dependencies
3939
run: pnpm install
4040

41-
- name: 🧪 Run Chromatic Visual Tests
41+
- name: 🧪 Run Chromatic Visual and Accessibility Tests
4242
uses: chromaui/action@a8ce9c58f59be5cc7090cadfc8f130fb08fcf0c3 # v15.1.0
43-
with:
44-
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
4543
env:
4644
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
4745
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

app/app.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ if (import.meta.server) {
4747
setJsonLd(createWebSiteSchema())
4848
}
4949
50+
const keyboardShortcuts = useKeyboardShortcuts()
51+
5052
onKeyDown(
5153
'/',
5254
e => {
53-
if (isEditableElement(e.target)) return
55+
if (!keyboardShortcuts.value || isEditableElement(e.target)) return
5456
e.preventDefault()
5557
5658
const searchInput = document.querySelector<HTMLInputElement>(
@@ -70,7 +72,7 @@ onKeyDown(
7072
onKeyDown(
7173
'?',
7274
e => {
73-
if (isEditableElement(e.target)) return
75+
if (!keyboardShortcuts.value || isEditableElement(e.target)) return
7476
e.preventDefault()
7577
showKbdHints.value = true
7678
},
@@ -80,7 +82,7 @@ onKeyDown(
8082
onKeyUp(
8183
'?',
8284
e => {
83-
if (isEditableElement(e.target)) return
85+
if (!keyboardShortcuts.value || isEditableElement(e.target)) return
8486
e.preventDefault()
8587
showKbdHints.value = false
8688
},

app/assets/logos/sponsors/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@ import LogoVercel from './vercel.svg'
22
import LogoVercelLight from './vercel-light.svg'
33
import LogoVoidZero from './void-zero.svg'
44
import LogoVoidZeroLight from './void-zero-light.svg'
5+
import LogoVlt from './vlt.svg'
6+
import LogoVltLight from './vlt-light.svg'
57

68
// The list is used on the about page. To add, simply upload the logos nearby and add an entry here. Prefer SVGs.
79
// For logo src, specify a string or object with the light and dark theme variants.
810
// Prefer original assets from partner sites to keep their brand identity.
911
//
1012
// If there are no original assets and the logo is not universal, you can add only the dark theme variant
1113
// and specify 'auto' for the light one - this will grayscale the logo and invert it in light mode.
14+
// The normalisingIndent is the Y-axis space to visually stabilize favicon-only logos with logotypes that contain long name.
1215
export const SPONSORS = [
1316
{
1417
name: 'Vercel',
1518
logo: {
1619
dark: LogoVercel,
1720
light: LogoVercelLight,
1821
},
22+
normalisingIndent: '0.875rem',
1923
url: 'https://vercel.com/',
2024
},
2125
{
@@ -24,6 +28,16 @@ export const SPONSORS = [
2428
dark: LogoVoidZero,
2529
light: LogoVoidZeroLight,
2630
},
31+
normalisingIndent: '0.875rem',
2732
url: 'https://voidzero.dev/',
2833
},
34+
{
35+
name: 'vlt',
36+
logo: {
37+
dark: LogoVlt,
38+
light: LogoVltLight,
39+
},
40+
normalisingIndent: '0.25rem',
41+
url: 'https://vlt.sh/',
42+
},
2943
]
Lines changed: 1 addition & 0 deletions
Loading

app/assets/logos/sponsors/vlt.svg

Lines changed: 1 addition & 0 deletions
Loading

app/assets/main.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,11 @@ input[type='search']::-webkit-search-results-decoration {
335335
animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
336336
}
337337

338+
/* Hide keyboard shortcut hints before hydration when user disabled them */
339+
:root[data-kbd-shortcuts='false'] [data-kbd-hint] {
340+
display: none;
341+
}
342+
338343
/* Locking the scroll whenever any of the modals are open */
339344
html:has(dialog:modal) {
340345
overflow: hidden;

app/components/About/LogoImg.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@ const props = defineProps<{
1111
</script>
1212
<template>
1313
<div v-if="typeof src === 'string'">
14-
<img :src="src" loading="lazy" height="36" class="w-auto block h-9" :alt="alt" />
14+
<img :src="src" loading="lazy" height="36" class="w-auto block h-full" :alt="alt" />
1515
</div>
16-
<div v-else-if="src.light === 'auto'">
16+
<div v-else-if="src.light === 'auto'" class="h-full">
1717
<img
1818
:src="src.dark"
1919
loading="lazy"
2020
height="36"
21-
class="w-auto block light:invert light:grayscale h-9"
21+
class="w-auto block light:invert light:grayscale h-full"
2222
:alt="alt"
2323
/>
2424
</div>
25-
<div v-else>
25+
<div v-else class="h-full">
2626
<img
2727
:src="src.dark"
2828
loading="lazy"
2929
height="36"
30-
class="w-auto block light:hidden h-9"
30+
class="w-auto block light:hidden h-full"
3131
:alt="alt"
3232
/>
3333
<img
3434
:src="src.light"
3535
loading="lazy"
3636
height="36"
37-
class="w-auto block hidden light:block h-9"
37+
class="w-auto block hidden light:block h-full"
3838
:alt="alt"
3939
/>
4040
</div>

app/components/About/LogoList.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
type BaseItem = {
33
name: string
44
url: string
5+
normalisingIndent?: string
56
logo:
67
| string
78
| {
@@ -21,14 +22,15 @@ const props = defineProps<{
2122
</script>
2223

2324
<template>
24-
<ul class="flex items-center flex-wrap gap-4 md:gap-x-6 md:gap-y-4 list-none">
25+
<ul class="flex flex-wrap gap-4 md:gap-x-6 md:gap-y-4 list-none">
2526
<li v-for="item in list" :key="item.name">
2627
<a
2728
v-if="'logo' in item"
2829
:href="item.url"
2930
target="_blank"
3031
rel="noopener noreferrer"
31-
class="flex items-center justify-center h-full min-w-11 rounded-md hover:bg-fg/10 transition-colors p-1"
32+
class="relative flex items-center justify-center h-14 min-w-14 rounded-md hover:bg-fg/10 transition-colors p-1"
33+
:style="{ paddingBlock: item.normalisingIndent }"
3234
:aria-label="item.name"
3335
>
3436
<AboutLogoImg :src="item.logo" :alt="item.name" />
@@ -53,7 +55,8 @@ const props = defineProps<{
5355
:href="groupItem.url"
5456
target="_blank"
5557
rel="noopener noreferrer"
56-
class="flex items-center justify-center h-full min-w-10 rounded-md hover:bg-fg/10 transition-colors p-0.5"
58+
class="relative flex items-center justify-center h-10 min-w-10 rounded-md hover:bg-fg/10 transition-colors p-0.5"
59+
:style="{ paddingBlock: groupItem.normalisingIndent }"
5760
:aria-label="groupItem.name"
5861
>
5962
<AboutLogoImg :src="groupItem.logo" :alt="groupItem.name" />

app/components/AppFooter.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const isHome = computed(() => route.name === 'index')
66
77
const modalRef = useTemplateRef('modalRef')
88
const showModal = () => modalRef.value?.showModal?.()
9+
const closeModal = () => modalRef.value?.close?.()
910
</script>
1011

1112
<template>
@@ -81,7 +82,7 @@ const showModal = () => modalRef.value?.showModal?.()
8182
<p class="mb-2 font-mono text-fg-subtle">
8283
{{ $t('shortcuts.section.package') }}
8384
</p>
84-
<ul class="mb-6 flex flex-col gap-2">
85+
<ul class="mb-8 flex flex-col gap-2">
8586
<li class="flex gap-2 items-center">
8687
<kbd class="kbd">.</kbd>
8788
<span>{{ $t('shortcuts.open_code_view') }}</span>
@@ -95,6 +96,19 @@ const showModal = () => modalRef.value?.showModal?.()
9596
<span>{{ $t('shortcuts.compare_from_package') }}</span>
9697
</li>
9798
</ul>
99+
<p class="text-fg-muted leading-relaxed">
100+
<i18n-t keypath="shortcuts.disable_shortcuts" tag="span" scope="global">
101+
<template #settings>
102+
<NuxtLink
103+
:to="{ name: 'settings' }"
104+
class="hover:text-fg underline decoration-fg-subtle/50 hover:decoration-fg"
105+
@click="closeModal"
106+
>
107+
{{ $t('settings.title') }}
108+
</NuxtLink>
109+
</template>
110+
</i18n-t>
111+
</p>
98112
</Modal>
99113
<LinkBase :to="NPMX_DOCS_SITE">
100114
{{ $t('footer.docs') }}

app/components/AppHeader.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import type { NavigationConfig, NavigationConfigWithGroups } from '~/types'
44
import { isEditableElement } from '~/utils/input'
55
import { NPMX_DOCS_SITE } from '#shared/utils/constants'
66
7+
const keyboardShortcuts = useKeyboardShortcuts()
8+
79
withDefaults(
810
defineProps<{
911
showLogo?: boolean
@@ -175,7 +177,7 @@ function handleSearchFocus() {
175177
176178
onKeyStroke(
177179
e => {
178-
if (isEditableElement(e.target)) {
180+
if (!keyboardShortcuts.value || isEditableElement(e.target)) {
179181
return
180182
}
181183

0 commit comments

Comments
 (0)