Skip to content

Commit b29eece

Browse files
committed
Merge branch 'main' into vt/changelog
2 parents 87a2f2a + 61c5b85 commit b29eece

28 files changed

+350
-209
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/components/AppHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/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/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

app/components/Filter/Panel.vue

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -243,22 +243,17 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
243243
role="radiogroup"
244244
:aria-label="$t('filters.weekly_downloads')"
245245
>
246-
<button
246+
<TagClickable
247247
v-for="range in DOWNLOAD_RANGES"
248248
:key="range.value"
249249
type="button"
250250
role="radio"
251251
:aria-checked="filters.downloadRange === range.value"
252-
class="tag transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1"
253-
:class="
254-
filters.downloadRange === range.value
255-
? 'bg-fg text-bg border-fg hover:text-bg/50'
256-
: ''
257-
"
252+
:status="filters.downloadRange === range.value ? 'active' : 'default'"
258253
@click="emit('update:downloadRange', range.value)"
259254
>
260255
{{ $t(getDownloadRangeLabelKey(range.value)) }}
261-
</button>
256+
</TagClickable>
262257
</div>
263258
</fieldset>
264259

@@ -272,22 +267,17 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
272267
role="radiogroup"
273268
:aria-label="$t('filters.updated_within')"
274269
>
275-
<button
270+
<TagClickable
276271
v-for="option in UPDATED_WITHIN_OPTIONS"
277272
:key="option.value"
278273
type="button"
279274
role="radio"
280275
:aria-checked="filters.updatedWithin === option.value"
281-
class="tag transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1"
282-
:class="
283-
filters.updatedWithin === option.value
284-
? 'bg-fg text-bg border-fg hover:text-bg/70'
285-
: ''
286-
"
276+
:status="filters.updatedWithin === option.value ? 'active' : 'default'"
287277
@click="emit('update:updatedWithin', option.value)"
288278
>
289279
{{ $t(getUpdatedWithinLabelKey(option.value)) }}
290-
</button>
280+
</TagClickable>
291281
</div>
292282
</fieldset>
293283

@@ -300,20 +290,17 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
300290
</span>
301291
</legend>
302292
<div class="flex flex-wrap gap-2" role="radiogroup" :aria-label="$t('filters.security')">
303-
<button
293+
<TagClickable
304294
v-for="security in SECURITY_FILTER_VALUES"
305295
:key="security"
306296
type="button"
307297
role="radio"
308298
disabled
309299
:aria-checked="filters.security === security"
310-
class="tag transition-colors duration-200 opacity-50 cursor-not-allowed focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1"
311-
:class="
312-
filters.security === security ? 'bg-fg text-bg border-fg hover:text-bg/70' : ''
313-
"
300+
:status="filters.security === security ? 'active' : 'default'"
314301
>
315302
{{ $t(getSecurityLabelKey(security)) }}
316-
</button>
303+
</TagClickable>
317304
</div>
318305
</fieldset>
319306

@@ -323,19 +310,16 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
323310
{{ $t('filters.keywords') }}
324311
</legend>
325312
<div class="flex flex-wrap gap-1.5" role="group" :aria-label="$t('filters.keywords')">
326-
<button
313+
<TagClickable
327314
v-for="keyword in displayedKeywords"
328315
:key="keyword"
329316
type="button"
330317
:aria-pressed="filters.keywords.includes(keyword)"
331-
class="tag text-xs transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1"
332-
:class="
333-
filters.keywords.includes(keyword) ? 'bg-fg text-bg border-fg hover:text-bg/70' : ''
334-
"
318+
:status="filters.keywords.includes(keyword) ? 'active' : 'default'"
335319
@click="emit('toggleKeyword', keyword)"
336320
>
337321
{{ keyword }}
338-
</button>
322+
</TagClickable>
339323
<button
340324
v-if="hasMoreKeywords"
341325
type="button"

app/components/Package/Card.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,20 @@ const pkgDescription = useMarkdown(() => ({
162162
:aria-label="$t('package.card.keywords')"
163163
class="relative z-10 flex flex-wrap gap-1.5 mt-3 pt-3 border-t border-border list-none m-0 p-0 pointer-events-none"
164164
>
165-
<button
165+
<TagClickable
166166
v-for="keyword in result.package.keywords.slice(0, 5)"
167167
:key="keyword"
168168
type="button"
169-
class="tag text-xs hover:bg-fg hover:text-bg hover:border-fg transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1 border-solid pointer-events-auto"
170-
:class="{ 'bg-fg text-bg hover:opacity-80': props.filters?.keywords.includes(keyword) }"
169+
class="pointer-events-auto"
170+
:status="props.filters?.keywords.includes(keyword) ? 'active' : 'default'"
171171
:title="`Filter by ${keyword}`"
172172
@click.stop="emit('clickKeyword', keyword)"
173173
>
174174
{{ keyword }}
175-
</button>
175+
</TagClickable>
176176
<span
177177
v-if="result.package.keywords.length > 5"
178-
class="tag text-fg-subtle text-xs border-none bg-transparent pointer-events-auto"
178+
class="text-fg-subtle text-xs pointer-events-auto"
179179
:title="result.package.keywords.slice(5).join(', ')"
180180
>
181181
+{{ result.package.keywords.length - 5 }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script setup lang="ts">
2+
const props = defineProps<{
3+
engines?: {
4+
node?: string
5+
npm?: string
6+
}
7+
}>()
8+
</script>
9+
<template>
10+
<CollapsibleSection
11+
v-if="engines && (engines.node || engines.npm)"
12+
:title="$t('package.compatibility')"
13+
id="compatibility"
14+
>
15+
<dl class="space-y-2">
16+
<div v-if="engines.node" class="flex justify-between gap-4 py-1">
17+
<dt class="text-fg-muted text-sm shrink-0">node</dt>
18+
<dd class="font-mono text-sm text-fg text-end" :title="engines.node">
19+
{{ engines.node }}
20+
</dd>
21+
</div>
22+
<div v-if="engines.npm" class="flex justify-between gap-4 py-1">
23+
<dt class="text-fg-muted text-sm shrink-0">npm</dt>
24+
<dd class="font-mono text-sm text-fg text-end" :title="engines.npm">
25+
{{ engines.npm }}
26+
</dd>
27+
</div>
28+
</dl>
29+
</CollapsibleSection>
30+
</template>

app/components/Package/DownloadAnalytics.vue

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,9 @@ const rootEl = shallowRef<HTMLElement | null>(null)
2020
2121
const { width } = useElementSize(rootEl)
2222
23-
const chartKey = ref(0)
24-
25-
let chartRemountTimeoutId: ReturnType<typeof setTimeout> | null = null
26-
2723
onMounted(() => {
2824
rootEl.value = document.documentElement
2925
resolvedMode.value = colorMode.value === 'dark' ? 'dark' : 'light'
30-
31-
// If the chart is painted too early, built-in auto-sizing does not adapt to the final container size
32-
chartRemountTimeoutId = setTimeout(() => {
33-
chartKey.value += 1
34-
chartRemountTimeoutId = null
35-
}, 1)
36-
})
37-
38-
onBeforeUnmount(() => {
39-
if (chartRemountTimeoutId !== null) {
40-
clearTimeout(chartRemountTimeoutId)
41-
chartRemountTimeoutId = null
42-
}
4326
})
4427
4528
const { colors } = useCssVariables(
@@ -718,12 +701,7 @@ const config = computed(() => {
718701
</div>
719702

720703
<ClientOnly v-if="inModal && chartData.dataset">
721-
<VueUiXy
722-
:dataset="chartData.dataset"
723-
:config="config"
724-
class="[direction:ltr]"
725-
:key="chartKey"
726-
>
704+
<VueUiXy :dataset="chartData.dataset" :config="config" class="[direction:ltr]">
727705
<template #menuIcon="{ isOpen }">
728706
<span v-if="isOpen" class="i-carbon:close w-6 h-6" aria-hidden="true" />
729707
<span v-else class="i-carbon:overflow-menu-vertical w-6 h-6" aria-hidden="true" />
@@ -836,8 +814,10 @@ const config = computed(() => {
836814
}
837815
838816
/* Override default placement of the refresh button to have it to the minimap's side */
839-
#download-analytics .vue-data-ui-refresh-button {
840-
top: -0.6rem !important;
841-
left: calc(100% + 2rem) !important;
817+
@media screen and (min-width: 767px) {
818+
#download-analytics .vue-data-ui-refresh-button {
819+
top: -0.6rem !important;
820+
left: calc(100% + 2rem) !important;
821+
}
842822
}
843823
</style>

app/components/Package/InstallScripts.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ const isExpanded = shallowRef(false)
1818
</script>
1919

2020
<template>
21-
<section>
22-
<h2
23-
id="install-scripts-heading"
24-
class="text-xs text-fg-subtle uppercase tracking-wider mb-3 flex items-center gap-2"
25-
>
26-
<span class="i-carbon:warning-alt w-3 h-3 text-yellow-500" aria-hidden="true" />
27-
{{ $t('package.install_scripts.title') }}
28-
</h2>
29-
21+
<CollapsibleSection
22+
:title="$t('package.install_scripts.title')"
23+
id="installScripts"
24+
icon="i-carbon:warning-alt w-3 h-3 text-yellow-500"
25+
>
3026
<!-- Script list: name as label, content below -->
3127
<dl class="space-y-2 m-0">
3228
<div v-for="scriptName in installScripts.scripts" :key="scriptName">
@@ -112,5 +108,5 @@ const isExpanded = shallowRef(false)
112108
</li>
113109
</ul>
114110
</div>
115-
</section>
111+
</CollapsibleSection>
116112
</template>

0 commit comments

Comments
 (0)