Skip to content

Commit c9b0c02

Browse files
authored
Merge branch 'main' into button-butter
2 parents 97a4282 + 29158b6 commit c9b0c02

158 files changed

Lines changed: 5024 additions & 810 deletions

File tree

Some content is hidden

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

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ This focus helps guide our project decisions as a community and what we choose t
4141
- [Naming conventions](#naming-conventions)
4242
- [Vue components](#vue-components)
4343
- [Internal linking](#internal-linking)
44+
- [Cursor and navigation](#cursor-and-navigation)
4445
- [RTL Support](#rtl-support)
4546
- [Localization (i18n)](#localization-i18n)
4647
- [Approach](#approach)
@@ -392,6 +393,18 @@ For package links, use the auto-imported `packageRoute()` utility from `app/util
392393
| `~username` | `/~:username` | `username` |
393394
| `~username-orgs` | `/~:username/orgs` | `username` |
394395

396+
### Cursor and navigation
397+
398+
**npmx** uses `cursor: pointer` only for links to match users’ everyday experience. For all other interactive elements, including buttons, use the default cursor (_or another appropriate cursor to indicate state_).
399+
400+
> [!NOTE]
401+
> A link is any element that leads to another content (_go to another page, authorize_)
402+
> A button is any element that operates an action (_show tooltip, open menu, "like" package, open dropdown_)
403+
> If you're unsure which element to use - feel free to ask question in the issue or on discord
404+
405+
> [!IMPORTANT]
406+
> Always Prefer implementing navigation as real links whenever possible. This ensures they can be opened in a new tab, shared or reloaded, and so the same content is available at a stable URL
407+
395408
## RTL Support
396409

397410
We support `right-to-left` languages, we need to make sure that the UI is working correctly in both directions.

app/app.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,9 @@ if (import.meta.client) {
121121
<template>
122122
<div class="min-h-screen flex flex-col bg-bg text-fg">
123123
<NuxtPwaAssets />
124-
<LinkBase
125-
:to="{ hash: '#main-content', query: route.query, params: route.params }"
126-
variant="button-primary"
127-
class="skip-link"
128-
>{{ $t('common.skip_link') }}</LinkBase
129-
>
124+
<LinkBase to="#main-content" external variant="button-primary" class="skip-link">{{
125+
$t('common.skip_link')
126+
}}</LinkBase>
130127

131128
<AppHeader :show-logo="!isHomepage" />
132129

app/components/AppFooter.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import { NPMX_DOCS_SITE } from '#shared/utils/constants'
3+
24
const route = useRoute()
35
const isHome = computed(() => route.name === 'index')
46
@@ -13,7 +15,9 @@ const showModal = () => modalRef.value?.showModal?.()
1315
class="flex flex-col sm:flex-row sm:flex-wrap items-center sm:items-baseline justify-between gap-2 sm:gap-4"
1416
>
1517
<div>
16-
<p class="font-mono text-balance m-0 hidden sm:block">{{ $t('tagline') }}</p>
18+
<p class="font-mono text-balance m-0 hidden sm:block">
19+
{{ $t('tagline') }}
20+
</p>
1721
</div>
1822
<!-- Desktop: Show all links. Mobile: Links are in MobileMenu -->
1923
<div class="hidden sm:flex items-center gap-6 min-h-11 text-xs">
@@ -92,7 +96,7 @@ const showModal = () => modalRef.value?.showModal?.()
9296
</li>
9397
</ul>
9498
</Modal>
95-
<LinkBase to="https://docs.npmx.dev">
99+
<LinkBase :to="NPMX_DOCS_SITE">
96100
{{ $t('footer.docs') }}
97101
</LinkBase>
98102
<LinkBase to="https://repo.npmx.dev">

app/components/AppHeader.vue

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { LinkBase } from '#components'
33
import type { NavigationConfig, NavigationConfigWithGroups } from '~/types'
44
import { isEditableElement } from '~/utils/input'
5+
import { NPMX_DOCS_SITE } from '#shared/utils/constants'
56
67
withDefaults(
78
defineProps<{
@@ -22,7 +23,7 @@ const desktopLinks = computed<NavigationConfig>(() => [
2223
keyshortcut: 'c',
2324
type: 'link',
2425
external: false,
25-
iconClass: 'i-carbon:compare',
26+
iconClass: 'i-lucide:git-compare',
2627
},
2728
{
2829
name: 'Settings',
@@ -31,7 +32,7 @@ const desktopLinks = computed<NavigationConfig>(() => [
3132
keyshortcut: ',',
3233
type: 'link',
3334
external: false,
34-
iconClass: 'i-carbon:settings',
35+
iconClass: 'i-lucide:settings',
3536
},
3637
])
3738
@@ -54,23 +55,23 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
5455
to: { name: 'about' },
5556
type: 'link',
5657
external: false,
57-
iconClass: 'i-carbon:information',
58+
iconClass: 'i-lucide:info',
5859
},
5960
{
6061
name: 'Privacy Policy',
6162
label: $t('privacy_policy.title'),
6263
to: { name: 'privacy' },
6364
type: 'link',
6465
external: false,
65-
iconClass: 'i-carbon:security',
66+
iconClass: 'i-lucide:shield-check',
6667
},
6768
{
6869
name: 'Accessibility',
6970
label: $t('a11y.title'),
7071
to: { name: 'accessibility' },
7172
type: 'link',
7273
external: false,
73-
iconClass: 'i-carbon:accessibility-alt',
74+
iconClass: 'i-custom:a11y',
7475
},
7576
],
7677
},
@@ -85,11 +86,11 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
8586
{
8687
name: 'Docs',
8788
label: $t('footer.docs'),
88-
href: 'https://docs.npmx.dev',
89+
href: NPMX_DOCS_SITE,
8990
target: '_blank',
9091
type: 'link',
9192
external: true,
92-
iconClass: 'i-carbon:document',
93+
iconClass: 'i-lucide:file-text',
9394
},
9495
{
9596
name: 'Source',
@@ -98,7 +99,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
9899
target: '_blank',
99100
type: 'link',
100101
external: true,
101-
iconClass: 'i-carbon:logo-github',
102+
iconClass: 'i-simple-icons:github',
102103
},
103104
{
104105
name: 'Social',
@@ -107,7 +108,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
107108
target: '_blank',
108109
type: 'link',
109110
external: true,
110-
iconClass: 'i-carbon:logo-bluesky',
111+
iconClass: 'i-simple-icons:bluesky',
111112
},
112113
{
113114
name: 'Chat',
@@ -116,7 +117,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
116117
target: '_blank',
117118
type: 'link',
118119
external: true,
119-
iconClass: 'i-carbon:chat',
120+
iconClass: 'i-lucide:message-circle',
120121
},
121122
],
122123
},
@@ -287,7 +288,7 @@ onKeyStroke(
287288
:aria-expanded="showMobileMenu"
288289
@click="expandMobileSearch"
289290
v-if="!isSearchExpanded && !isOnHomePage"
290-
classicon="i-carbon:search"
291+
classicon="i-lucide:search"
291292
/>
292293

293294
<!-- Mobile: Menu button (always visible, click to open menu) -->
@@ -297,7 +298,7 @@ onKeyStroke(
297298
:aria-label="$t('nav.open_menu')"
298299
:aria-expanded="showMobileMenu"
299300
@click="showMobileMenu = !showMobileMenu"
300-
classicon="i-carbon:menu"
301+
classicon="i-lucide:menu"
301302
/>
302303
</nav>
303304

app/components/BlueskyPostEmbed.client.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const { data: post, status } = useAsyncData(
8383
<div class="text-sm text-fg-subtle truncate">@{{ post.author.handle }}</div>
8484
</div>
8585
<span
86-
class="i-carbon:logo-bluesky w-5 h-5 text-fg-subtle ms-auto shrink-0"
86+
class="i-simple-icons:bluesky w-5 h-5 text-fg-subtle ms-auto shrink-0"
8787
aria-hidden="true"
8888
/>
8989
</div>
@@ -112,15 +112,15 @@ const { data: post, status } = useAsyncData(
112112
<div class="flex items-center gap-4 text-sm text-fg-subtle">
113113
<DateTime :datetime="post.record.createdAt" date-style="medium" />
114114
<span v-if="post.likeCount" class="flex items-center gap-1">
115-
<span class="i-carbon:favorite w-3.5 h-3.5" aria-hidden="true" />
115+
<span class="i-lucide:heart w-3.5 h-3.5" aria-hidden="true" />
116116
{{ post.likeCount }}
117117
</span>
118118
<span v-if="post.repostCount" class="flex items-center gap-1">
119-
<span class="i-carbon:repeat w-3.5 h-3.5" aria-hidden="true" />
119+
<span class="i-lucide:repeat w-3.5 h-3.5" aria-hidden="true" />
120120
{{ post.repostCount }}
121121
</span>
122122
<span v-if="post.replyCount" class="flex items-center gap-1">
123-
<span class="i-carbon:chat w-3.5 h-3.5" aria-hidden="true" />
123+
<span class="i-lucide:message-circle w-3.5 h-3.5" aria-hidden="true" />
124124
{{ post.replyCount }}
125125
</span>
126126
</div>

app/components/Button/Base.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defineExpose({
2727
<template>
2828
<button
2929
ref="el"
30-
class="group cursor-pointer gap-x-1.5 relative items-center justify-center rounded-md active:scale-[0.98] font-mono border border-solid border-border transition-colors duration-200 outline-transparent focus-visible:(outline-2 outline-accent outline-offset-2) disabled:(opacity-40 cursor-not-allowed border-transparent)"
30+
class="group gap-x-1.5 relative items-center justify-center rounded-md active:scale-[0.98] font-mono border border-solid border-border transition-colors duration-200 outline-transparent focus-visible:(outline-2 outline-accent outline-offset-2) disabled:(opacity-40 cursor-not-allowed border-transparent)"
3131
:class="{
3232
'inline-flex': !block,
3333
'flex': block,

app/components/CallToAction.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ const socialLinks = computed(() => [
33
{
44
id: 'github',
55
href: 'https://repo.npmx.dev',
6-
icon: 'i-carbon:logo-github',
6+
icon: 'i-simple-icons:github',
77
titleKey: $t('about.get_involved.contribute.title'),
88
descriptionKey: $t('about.get_involved.contribute.description'),
99
ctaKey: $t('about.get_involved.contribute.cta'),
1010
},
1111
{
1212
id: 'discord',
1313
href: 'https://chat.npmx.dev',
14-
icon: 'i-carbon:chat',
14+
icon: 'i-lucide:message-circle',
1515
titleKey: $t('about.get_involved.community.title'),
1616
descriptionKey: $t('about.get_involved.community.description'),
1717
ctaKey: $t('about.get_involved.community.cta'),
1818
},
1919
{
2020
id: 'bluesky',
2121
href: 'https://social.npmx.dev',
22-
icon: 'i-carbon:logo-bluesky',
22+
icon: 'i-simple-icons:bluesky',
2323
titleKey: $t('about.get_involved.follow.title'),
2424
descriptionKey: $t('about.get_involved.follow.description'),
2525
ctaKey: $t('about.get_involved.follow.cta'),
@@ -55,7 +55,7 @@ const socialLinks = computed(() => [
5555
class="text-sm text-fg-muted group-hover:text-fg inline-flex items-center gap-1 mt-auto focus-visible:outline-none"
5656
>
5757
{{ link.ctaKey }}
58-
<span class="i-carbon:arrow-right rtl-flip w-3 h-3" aria-hidden="true" />
58+
<span class="i-lucide:arrow-right rtl-flip w-3 h-3" aria-hidden="true" />
5959
<span class="absolute z-0 inset-0" aria-hidden="true" />
6060
</a>
6161
</div>

app/components/Code/FileTree.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ watch(
5959
:aria-pressed="isNodeActive(node)"
6060
:style="{ paddingLeft: `${depth * 12 + 12}px` }"
6161
@click="toggleDir(node.path)"
62-
:classicon="isExpanded(node.path) ? 'i-carbon:chevron-down' : 'i-carbon:chevron-right'"
62+
:classicon="isExpanded(node.path) ? 'i-lucide:chevron-down' : 'i-lucide:chevron-right'"
6363
>
6464
<svg
6565
class="size-[1em] me-1 shrink-0"

app/components/Code/MobileTreeDrawer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ watch(isOpen, open => (isLocked.value = open))
3232
class="md:hidden fixed bottom-4 inset-ie-4 z-45"
3333
:aria-label="$t('code.toggle_tree')"
3434
@click="isOpen = !isOpen"
35-
:classicon="isOpen ? 'i-carbon:close' : 'i-carbon:folder'"
35+
:classicon="isOpen ? 'i-lucide:x' : 'i-lucide:folder'"
3636
/>
3737

3838
<!-- Backdrop -->
@@ -68,7 +68,7 @@ watch(isOpen, open => (isLocked.value = open))
6868
<ButtonBase
6969
:aria-label="$t('code.close_tree')"
7070
@click="isOpen = false"
71-
classicon="i-carbon-close"
71+
classicon="i-lucide:x"
7272
/>
7373
</div>
7474
<CodeFileTree

app/components/CollapsibleSection.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,11 @@ useHead({
9292
:aria-label="ariaLabel"
9393
@click="toggle"
9494
>
95-
<span
96-
v-if="isLoading"
97-
class="i-carbon:rotate-180 w-3 h-3 motion-safe:animate-spin"
98-
aria-hidden="true"
99-
/>
95+
<span v-if="isLoading" class="i-svg-spinners:ring-resize w-3 h-3" aria-hidden="true" />
10096
<span
10197
v-else
10298
class="w-3 h-3 transition-transform duration-200"
103-
:class="isOpen ? 'i-carbon:chevron-down' : 'i-carbon:chevron-right'"
99+
:class="isOpen ? 'i-lucide:chevron-down' : 'i-lucide:chevron-right'"
104100
aria-hidden="true"
105101
/>
106102
</button>

0 commit comments

Comments
 (0)