Skip to content

Commit c5e939e

Browse files
committed
chore: merge remote-tracking branch 'origin' into feature/provenance
- fix conflicts in a11y.spec
2 parents 23582b9 + 9ee64a0 commit c5e939e

File tree

125 files changed

+3247
-1357
lines changed

Some content is hidden

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

125 files changed

+3247
-1357
lines changed

.github/workflows/provenance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414
contents: read
1515
jobs:
1616
check-provenance:
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-slim
1818
steps:
1919
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2020
with:

.github/workflows/semantic-pull-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
1717
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
1818
if: github.repository == 'npmx-dev/npmx.dev'
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-slim
2020
name: semantic-pr
2121
steps:
2222
- name: Validate PR title

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: 58 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 */

app/components/AppHeader.vue

Lines changed: 2 additions & 2 deletions
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')
@@ -146,7 +146,7 @@ onKeyStroke(
146146
@blur="handleSearchBlur"
147147
/>
148148
<ul
149-
v-if="!isSearchExpanded"
149+
v-if="!isSearchExpanded && isConnected && npmUser"
150150
:class="{ hidden: showFullSearch }"
151151
class="hidden sm:flex items-center gap-4 sm:gap-6 list-none m-0 p-0"
152152
>

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/CollapsibleSection.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface Props {
66
isLoading?: boolean
77
headingLevel?: `h${number}`
88
id: string
9+
icon?: string
910
}
1011
1112
const props = withDefaults(defineProps<Props>(), {
@@ -107,6 +108,7 @@ useHead({
107108
:href="`#${id}`"
108109
class="inline-flex items-center gap-1.5 text-fg-subtle hover:text-fg-muted transition-colors duration-200 no-underline"
109110
>
111+
<span v-if="icon" :class="icon" aria-hidden="true" />
110112
{{ title }}
111113
<span
112114
class="i-carbon:link w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity duration-200"

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/Chips.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const emit = defineEmits<{
1414
<template>
1515
<div v-if="chips.length > 0" class="flex flex-wrap items-center gap-2">
1616
<TransitionGroup name="chip">
17-
<span v-for="chip in chips" :key="chip.id" class="tag gap-1">
17+
<TagStatic v-for="chip in chips" :key="chip.id" class="gap-1">
1818
<span class="text-fg-subtle text-xs">{{ chip.label }}:</span>
1919
<span class="max-w-32 truncate">{{
2020
Array.isArray(chip.value) ? chip.value.join(', ') : chip.value
@@ -27,7 +27,7 @@ const emit = defineEmits<{
2727
>
2828
<span class="i-carbon-close w-3 h-3" aria-hidden="true" />
2929
</button>
30-
</span>
30+
</TagStatic>
3131
</TransitionGroup>
3232

3333
<button

0 commit comments

Comments
 (0)