Skip to content

Commit 9d39380

Browse files
authored
Merge branch 'main' into feat/hourly-npmx-picks
2 parents f28fbd2 + 85ac3d7 commit 9d39380

60 files changed

Lines changed: 3076 additions & 357 deletions

Some content is hidden

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

.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 }}

.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { StorybookConfig } from '@storybook-vue/nuxt'
22

33
const config = {
44
stories: ['../app/**/*.stories.@(js|ts)'],
5-
addons: ['@storybook/addon-a11y', '@storybook/addon-docs'],
5+
addons: ['@storybook/addon-a11y', '@storybook/addon-docs', '@storybook/addon-themes'],
66
framework: '@storybook-vue/nuxt',
77
features: {
88
backgrounds: false,

.storybook/preview.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Preview } from '@storybook-vue/nuxt'
2+
import { withThemeByDataAttribute } from '@storybook/addon-themes'
23
import { currentLocales } from '../config/i18n'
34
import { fn } from 'storybook/test'
45
import { ACCENT_COLORS } from '../shared/utils/constants'
@@ -58,31 +59,22 @@ const preview: Preview = {
5859
],
5960
},
6061
},
61-
theme: {
62-
name: 'Theme',
63-
description: 'Color mode',
64-
defaultValue: 'dark',
65-
toolbar: {
66-
icon: 'moon',
67-
dynamicTitle: true,
68-
items: [
69-
{ value: 'light', icon: 'sun', title: 'Light' },
70-
{ value: 'dark', icon: 'moon', title: 'Dark' },
71-
],
72-
},
73-
},
7462
},
7563
decorators: [
64+
withThemeByDataAttribute({
65+
themes: {
66+
Light: 'light',
67+
Dark: 'dark',
68+
},
69+
defaultTheme: 'Dark',
70+
attributeName: 'data-theme',
71+
}),
7672
(story, context) => {
77-
const { locale, theme, accentColor } = context.globals as {
73+
const { locale, accentColor } = context.globals as {
7874
locale: string
79-
theme: string
8075
accentColor?: string
8176
}
8277

83-
// Set theme from globals
84-
document.documentElement.setAttribute('data-theme', theme)
85-
8678
// Set accent color from globals
8779
if (accentColor) {
8880
document.documentElement.style.setProperty('--accent-color', `var(--swatch-${accentColor})`)

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" />

0 commit comments

Comments
 (0)