Skip to content

Commit d6acbe4

Browse files
committed
Merge branch 'main' of https://github.com/alex-key/npmx.dev into fix/search-results-limit
2 parents 739a3a7 + 3712560 commit d6acbe4

50 files changed

Lines changed: 1718 additions & 972 deletions

Some content is hidden

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

app/assets/main.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,16 @@ dd {
275275
}
276276

277277
/* Shiki theme colors */
278-
html.light .shiki,
279-
html.light .shiki span {
278+
html.light .shiki {
280279
color: var(--shiki-light) !important;
281280
background-color: var(--shiki-light-bg) !important;
282-
font-style: var(--shiki-light-font-style) !important;
283-
font-weight: var(--shiki-light-font-weight) !important;
284-
text-decoration: var(--shiki-light-text-decoration) !important;
281+
282+
& span {
283+
color: var(--shiki-light) !important;
284+
font-style: var(--shiki-light-font-style) !important;
285+
font-weight: var(--shiki-light-font-weight) !important;
286+
text-decoration: var(--shiki-light-text-decoration) !important;
287+
}
285288
}
286289

287290
/* Inline code in package descriptions */

app/components/Compare/FacetBarChart.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,18 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
220220
const name = datapoint?.name?.replace(/\n/g, '<br>')
221221
return `
222222
<div class="font-mono p-3 border border-border rounded-md bg-[var(--bg)]/10 backdrop-blur-md">
223-
<div class="flex items-center gap-2">
223+
<div class="grid grid-cols-[12px_minmax(0,1fr)_max-content] items-center gap-x-3">
224224
<div class="w-3 h-3">
225225
<svg viewBox="0 0 2 2" class="w-full h-full">
226226
<rect x="0" y="0" width="2" height="2" rx="0.3" fill="${datapoint?.color}" />
227227
</svg>
228228
</div>
229-
<span>${name}: ${(datapoint as VueUiHorizontalBarDatapoint).formattedValue ?? 0}</span>
229+
<span class="text-3xs uppercase tracking-wide text-[var(--fg)]/70 truncate">
230+
${name}
231+
</span>
232+
<span class="text-base text-[var(--fg)] font-mono tabular-nums text-end">
233+
${(datapoint as VueUiHorizontalBarDatapoint).formattedValue ?? 0}
234+
</span>
230235
</div>
231236
</div>
232237
`

app/components/Header/SearchBox.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ defineExpose({ focus })
4444

4545
<div class="relative group" :class="{ 'is-focused': isSearchFocused }">
4646
<div class="search-box relative flex items-center">
47-
<span
48-
class="absolute inset-is-3 text-fg-subtle font-mono text-sm pointer-events-none transition-colors duration-200 motion-reduce:transition-none [.group:hover:not(:focus-within)_&]:text-fg/80 group-focus-within:text-accent z-1"
47+
<kbd
48+
class="absolute inset-is-3 text-fg-subtle font-mono text-sm pointer-events-none transition-colors duration-200 motion-reduce:transition-none [.group:hover:not(:focus-within)_&]:text-fg/80 group-focus-within:text-accent z-1 rounded"
49+
aria-hidden="true"
4950
>
5051
/
51-
</span>
52+
</kbd>
5253

5354
<InputBase
5455
id="header-search"
@@ -62,6 +63,7 @@ defineExpose({ focus })
6263
@focus="isSearchFocused = true"
6364
@blur="isSearchFocused = false"
6465
size="small"
66+
ariaKeyshortcuts="/"
6567
/>
6668
<button
6769
v-if="hasSearchQuery"

app/components/Input/Base.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const props = withDefaults(
1414
* @default true
1515
*/
1616
noCorrect?: boolean
17+
/** Keyboard shortcut hint */
18+
ariaKeyshortcuts?: string
1719
}>(),
1820
{
1921
size: 'medium',
@@ -28,6 +30,8 @@ const emit = defineEmits<{
2830
2931
const el = useTemplateRef('el')
3032
33+
const keyboardShortcutsEnabled = useKeyboardShortcuts()
34+
3135
defineExpose({
3236
focus: () => el.value?.focus(),
3337
blur: () => el.value?.blur(),
@@ -51,5 +55,6 @@ defineExpose({
5155
/** Catching Vue render-bug of invalid `disabled=false` attribute in the final HTML */
5256
disabled ? true : undefined
5357
"
58+
:aria-keyshortcuts="keyboardShortcutsEnabled ? ariaKeyshortcuts : undefined"
5459
/>
5560
</template>

0 commit comments

Comments
 (0)