Skip to content

Commit 22c8511

Browse files
committed
Merge branch 'main' into vt/readme-toc
2 parents 73acb8f + 8d99bb0 commit 22c8511

File tree

150 files changed

+5463
-1390
lines changed

Some content is hidden

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

150 files changed

+5463
-1390
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#secure password, can use openssl rand --hex 32
1+
#secure password, can use openssl rand -hex 32
22
NUXT_SESSION_PASSWORD=""

.lighthouserc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
url: [
3030
'http://localhost:3000/',
3131
'http://localhost:3000/search?q=nuxt',
32-
'http://localhost:3000/nuxt',
32+
'http://localhost:3000/package/nuxt',
3333
],
3434
numberOfRuns: 1,
3535
chromePath: findChrome(),

app/app.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,37 @@ function handleGlobalKeyup() {
7979
showKbdHints.value = false
8080
}
8181
82-
/* A hack to get light dismiss to work in safari because it does not support closedby="any" yet */
82+
// Light dismiss fallback for browsers that don't support closedby="any" (Safari + old Chrome/Firefox)
8383
// https://codepen.io/paramagicdev/pen/gbYompq
8484
// see: https://github.com/npmx-dev/npmx.dev/pull/522#discussion_r2749978022
8585
function handleModalLightDismiss(e: MouseEvent) {
8686
const target = e.target as HTMLElement
8787
if (target.tagName === 'DIALOG' && target.hasAttribute('open')) {
88+
const rect = target.getBoundingClientRect()
89+
const isOutside =
90+
e.clientX < rect.left ||
91+
e.clientX > rect.right ||
92+
e.clientY < rect.top ||
93+
e.clientY > rect.bottom
94+
95+
if (!isOutside) return
8896
;(target as HTMLDialogElement).close()
8997
}
9098
}
9199
92100
if (import.meta.client) {
93101
useEventListener(document, 'keydown', handleGlobalKeydown)
94102
useEventListener(document, 'keyup', handleGlobalKeyup)
95-
useEventListener(document, 'click', handleModalLightDismiss)
103+
104+
// Feature check for native light dismiss support via closedby="any"
105+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog#closedby
106+
const supportsClosedBy =
107+
typeof HTMLDialogElement !== 'undefined' &&
108+
typeof HTMLDialogElement.prototype === 'object' &&
109+
'closedBy' in HTMLDialogElement.prototype
110+
if (!supportsClosedBy) {
111+
useEventListener(document, 'click', handleModalLightDismiss)
112+
}
96113
}
97114
</script>
98115

app/assets/main.css

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77

88
:root[data-theme='dark'] {
99
/* background colors */
10-
--bg: oklch(0.145 0 0);
11-
--bg-subtle: oklch(0.178 0 0);
12-
--bg-muted: oklch(0.218 0 0);
13-
--bg-elevated: oklch(0.252 0 0);
10+
--bg: var(--bg-color, oklch(0.145 0 0));
11+
--bg-subtle: var(--bg-subtle-color, oklch(0.178 0 0));
12+
--bg-muted: var(--bg-muted-color, oklch(0.218 0 0));
13+
--bg-elevated: var(--bg-elevated-color, oklch(0.252 0 0));
1414

1515
/* text colors */
1616
--fg: oklch(0.985 0 0);
1717
--fg-muted: oklch(0.709 0 0);
1818
--fg-subtle: oklch(0.633 0 0);
1919

20-
/* border, seperator colors */
20+
/* border, separator colors */
2121
--border: oklch(0.269 0 0);
2222
--border-subtle: oklch(0.239 0 0);
2323
--border-hover: oklch(0.371 0 0);
@@ -43,11 +43,39 @@
4343
--badge-pink: oklch(0.584 0.189 343);
4444
}
4545

46+
:root[data-theme='dark'][data-bg-theme='slate'] {
47+
--bg: oklch(0.129 0.012 264.695);
48+
--bg-subtle: oklch(0.159 0.022 262.421);
49+
--bg-muted: oklch(0.204 0.033 261.234);
50+
--bg-elevated: oklch(0.259 0.041 260.031);
51+
}
52+
53+
:root[data-theme='dark'][data-bg-theme='zinc'] {
54+
--bg: oklch(0.141 0.005 285.823);
55+
--bg-subtle: oklch(0.168 0.005 285.894);
56+
--bg-muted: oklch(0.209 0.005 285.929);
57+
--bg-elevated: oklch(0.256 0.006 286.033);
58+
}
59+
60+
:root[data-theme='dark'][data-bg-theme='stone'] {
61+
--bg: oklch(0.147 0.004 49.25);
62+
--bg-subtle: oklch(0.178 0.004 49.321);
63+
--bg-muted: oklch(0.218 0.004 49.386);
64+
--bg-elevated: oklch(0.252 0.007 34.298);
65+
}
66+
67+
:root[data-theme='dark'][data-bg-theme='black'] {
68+
--bg: oklch(0 0 0);
69+
--bg-subtle: oklch(0.148 0 0);
70+
--bg-muted: oklch(0.204 0 0);
71+
--bg-elevated: oklch(0.264 0 0);
72+
}
73+
4674
:root[data-theme='light'] {
47-
--bg: oklch(1 0 0);
48-
--bg-subtle: oklch(0.979 0.001 286.375);
49-
--bg-muted: oklch(0.955 0 0);
50-
--bg-elevated: oklch(0.94 0 0);
75+
--bg: var(--bg-color, oklch(1 0 0));
76+
--bg-subtle: var(--bg-subtle-color, oklch(0.979 0.001 286.375));
77+
--bg-muted: var(--bg-muted-color, oklch(0.955 0 0));
78+
--bg-elevated: var(--bg-elevated-color, oklch(0.94 0 0));
5179

5280
--fg: oklch(0.145 0 0);
5381
--fg-muted: oklch(0.439 0 0);
@@ -75,6 +103,27 @@
75103
--badge-cyan: oklch(0.571 0.181 210);
76104
}
77105

106+
:root[data-theme='light'][data-bg-theme='slate'] {
107+
--bg: oklch(1 0 0);
108+
--bg-subtle: oklch(0.982 0.006 264.62);
109+
--bg-muted: oklch(0.96 0.041 261.234);
110+
--bg-elevated: oklch(0.943 0.013 255.52);
111+
}
112+
113+
:root[data-theme='light'][data-bg-theme='zinc'] {
114+
--bg: oklch(1 0 0);
115+
--bg-subtle: oklch(0.979 0.004 286.53);
116+
--bg-muted: oklch(0.958 0.004 286.39);
117+
--bg-elevated: oklch(0.939 0.004 286.32);
118+
}
119+
120+
:root[data-theme='light'][data-bg-theme='stone'] {
121+
--bg: oklch(1 0 0);
122+
--bg-subtle: oklch(0.979 0.005 48.762);
123+
--bg-muted: oklch(0.958 0.005 48.743);
124+
--bg-elevated: oklch(0.943 0.005 48.731);
125+
}
126+
78127
@media (prefers-contrast: more) {
79128
:root[data-theme='dark'] {
80129
/* text colors */
@@ -199,6 +248,14 @@ button {
199248
background: #404040;
200249
}
201250

251+
/* Scrollbar styling for Firefox */
252+
@supports not selector(::-webkit-scrollbar) {
253+
* {
254+
scrollbar-width: thin;
255+
scrollbar-color: var(--border) var(--bg);
256+
}
257+
}
258+
202259
/* Shiki theme colors */
203260
html.light .shiki,
204261
html.light .shiki span {

app/components/AppFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const isHome = computed(() => route.name === 'index')
77
<footer class="border-t border-border mt-auto">
88
<div class="container py-3 sm:py-8 flex flex-col gap-2 sm:gap-4 text-fg-subtle text-sm">
99
<div
10-
class="flex flex-col sm:flex-row items-center sm:items-baseline justify-between gap-2 sm:gap-4"
10+
class="flex flex-col sm:flex-row sm:flex-wrap items-center sm:items-baseline justify-between gap-2 sm:gap-4"
1111
>
1212
<div>
1313
<p class="font-mono text-balance m-0 hidden sm:block">{{ $t('tagline') }}</p>

app/components/AppHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const showMobileMenu = shallowRef(false)
1919
const route = useRoute()
2020
const isMobile = useIsMobile()
2121
const isSearchExpandedManually = shallowRef(false)
22-
const searchBoxRef = shallowRef<{ focus: () => void } | null>(null)
22+
const searchBoxRef = useTemplateRef('searchBoxRef')
2323
2424
// On search page, always show search expanded on mobile
2525
const isOnHomePage = computed(() => route.name === 'index')

app/components/BaseCard.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
/** Whether this is an exact match for the query */
4+
isExactMatch?: boolean
5+
}>()
6+
</script>
7+
8+
<template>
9+
<article
10+
class="group bg-bg-subtle border border-border rounded-lg p-4 sm:p-6 transition-[border-color,background-color] duration-200 hover:(border-border-hover bg-bg-muted) cursor-pointer relative focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-bg focus-within:ring-offset-2 focus-within:ring-fg/50 focus-within:bg-bg-muted focus-within:border-border-hover"
11+
:class="{
12+
'border-accent/30 contrast-more:border-accent/90 bg-accent/5': isExactMatch,
13+
}"
14+
>
15+
<!-- Glow effect for exact matches -->
16+
<div
17+
v-if="isExactMatch"
18+
class="absolute -inset-px rounded-lg bg-gradient-to-r from-accent/0 via-accent/20 to-accent/0 opacity-100 blur-sm -z-1 pointer-events-none motion-reduce:opacity-50"
19+
aria-hidden="true"
20+
/>
21+
<slot />
22+
</article>
23+
</template>

app/components/CallToAction.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const socialLinks = {
1212
{{ $t('about.get_involved.title') }}
1313
</h2>
1414

15-
<div class="grid gap-4 sm:grid-cols-3">
15+
<div class="grid gap-4 sm:grid-cols-3 sm:items-stretch sm:grid-rows-[auto,1fr,auto]">
1616
<a
1717
:href="socialLinks.github"
1818
target="_blank"
1919
rel="noopener noreferrer"
20-
class="group flex flex-col gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200"
20+
class="group grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3"
2121
>
2222
<div class="flex gap-2">
2323
<span class="i-carbon:logo-github shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden="true" />
@@ -40,7 +40,7 @@ const socialLinks = {
4040
:href="socialLinks.discord"
4141
target="_blank"
4242
rel="noopener noreferrer"
43-
class="group flex flex-col gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200"
43+
class="group grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3"
4444
>
4545
<div class="flex gap-2">
4646
<span class="i-carbon:chat shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden="true" />
@@ -63,7 +63,7 @@ const socialLinks = {
6363
:href="socialLinks.bluesky"
6464
target="_blank"
6565
rel="noopener noreferrer"
66-
class="group flex flex-col gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200"
66+
class="group grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3"
6767
>
6868
<div class="flex gap-2">
6969
<span class="i-simple-icons:bluesky shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden="true" />

app/components/ColumnPicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const columnLabelKey: Record<string, string> = {
4242
version: 'filters.columns.version',
4343
description: 'filters.columns.description',
4444
downloads: 'filters.columns.downloads',
45-
updated: 'filters.columns.updated',
45+
updated: 'filters.columns.published',
4646
maintainers: 'filters.columns.maintainers',
4747
keywords: 'filters.columns.keywords',
4848
qualityScore: 'filters.columns.quality_score',

app/components/Filter/Panel.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import type {
88
} from '#shared/types/preferences'
99
import {
1010
DOWNLOAD_RANGES,
11-
SEARCH_SCOPE_OPTIONS,
12-
SECURITY_FILTER_OPTIONS,
11+
SEARCH_SCOPE_VALUES,
12+
SECURITY_FILTER_VALUES,
1313
UPDATED_WITHIN_OPTIONS,
1414
} from '#shared/types/preferences'
1515
@@ -205,20 +205,20 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
205205
:aria-label="$t('filters.search_scope')"
206206
>
207207
<button
208-
v-for="option in SEARCH_SCOPE_OPTIONS"
209-
:key="option.value"
208+
v-for="scope in SEARCH_SCOPE_VALUES"
209+
:key="scope"
210210
type="button"
211211
class="px-2 py-0.5 text-xs font-mono rounded-sm transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1"
212212
:class="
213-
filters.searchScope === option.value
213+
filters.searchScope === scope
214214
? 'bg-bg-muted text-fg'
215215
: 'text-fg-muted hover:text-fg'
216216
"
217-
:aria-pressed="filters.searchScope === option.value"
218-
:title="$t(getScopeDescriptionKey(option.value))"
219-
@click="emit('update:searchScope', option.value)"
217+
:aria-pressed="filters.searchScope === scope"
218+
:title="$t(getScopeDescriptionKey(scope))"
219+
@click="emit('update:searchScope', scope)"
220220
>
221-
{{ $t(getScopeLabelKey(option.value)) }}
221+
{{ $t(getScopeLabelKey(scope)) }}
222222
</button>
223223
</div>
224224
</div>
@@ -228,7 +228,7 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
228228
:value="filters.text"
229229
:placeholder="searchPlaceholder"
230230
autocomplete="off"
231-
class="input-base"
231+
class="w-full bg-bg-subtle border border-border rounded-md px-4 py-3 font-mono text-sm text-fg placeholder:text-fg-subtle transition-all duration-200 focus:(border-fg/40 outline-none ring-1 ring-fg/10)"
232232
@input="handleTextInput"
233233
/>
234234
</div>
@@ -301,18 +301,18 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
301301
</legend>
302302
<div class="flex flex-wrap gap-2" role="radiogroup" :aria-label="$t('filters.security')">
303303
<button
304-
v-for="option in SECURITY_FILTER_OPTIONS"
305-
:key="option.value"
304+
v-for="security in SECURITY_FILTER_VALUES"
305+
:key="security"
306306
type="button"
307307
role="radio"
308308
disabled
309-
:aria-checked="filters.security === option.value"
309+
:aria-checked="filters.security === security"
310310
class="tag transition-colors duration-200 opacity-50 cursor-not-allowed focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1"
311311
:class="
312-
filters.security === option.value ? 'bg-fg text-bg border-fg hover:text-bg/70' : ''
312+
filters.security === security ? 'bg-fg text-bg border-fg hover:text-bg/70' : ''
313313
"
314314
>
315-
{{ $t(getSecurityLabelKey(option.value)) }}
315+
{{ $t(getSecurityLabelKey(security)) }}
316316
</button>
317317
</div>
318318
</fieldset>

0 commit comments

Comments
 (0)