Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/components/Button/Base.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { IconClass } from '~/types'

const props = withDefaults(
defineProps<{
disabled?: boolean
Expand All @@ -8,7 +10,7 @@ const props = withDefaults(
ariaKeyshortcuts?: string
block?: boolean

classicon?: string
classicon?: IconClass
}>(),
{
type: 'button',
Expand Down
3 changes: 2 additions & 1 deletion app/components/Link/Base.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { NuxtLinkProps } from '#app'
import type { IconClass } from '~/types'

const props = withDefaults(
defineProps<
Expand All @@ -26,7 +27,7 @@ const props = withDefaults(
*/
rel?: never

classicon?: string
classicon?: IconClass

to?: NuxtLinkProps['to']

Expand Down
4 changes: 3 additions & 1 deletion app/components/Tag/Static.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<script setup lang="ts">
import type { IconClass } from '~/types'

const props = withDefaults(
defineProps<{
as?: string | Component
variant?: 'ghost' | 'default'

classicon?: string
classicon?: IconClass
}>(),
{ as: 'span', variant: 'default' },
)
Expand Down
8 changes: 5 additions & 3 deletions app/pages/package/[[org]]/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
SkillsListResponse,
} from '#shared/types'
import type { JsrPackageInfo } from '#shared/types/jsr'
import type { IconClass } from '~/types'
import { assertValidPackageName } from '#shared/utils/npm'
import { joinURL } from 'ufo'
import { areUrlsEquivalent } from '#shared/utils/url'
Expand Down Expand Up @@ -245,8 +246,9 @@ const { copied: copiedPkgName, copy: copyPkgName } = useClipboard({
})

//copy version name
//orginally only copied name and not version number
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment thread
danielroe marked this conversation as resolved.
Outdated
const { copied: copiedVersion, copy: copyVersion } = useClipboard({
source: resolvedVersion.value ?? '',
source: () => resolvedVersion.value ?? '',
copiedDuring: 2000,
})

Expand Down Expand Up @@ -398,7 +400,7 @@ const repositoryUrl = computed(() => {

const { meta: repoMeta, repoRef, stars, starsLink, forks, forksLink } = useRepoMeta(repositoryUrl)

const PROVIDER_ICONS: Record<string, string> = {
const PROVIDER_ICONS: Record<string, IconClass> = {
github: 'i-simple-icons:github',
gitlab: 'i-simple-icons:gitlab',
bitbucket: 'i-simple-icons:bitbucket',
Expand All @@ -411,7 +413,7 @@ const PROVIDER_ICONS: Record<string, string> = {
radicle: 'i-lucide:network', // Radicle is a P2P network, using network icon
}

const repoProviderIcon = computed(() => {
const repoProviderIcon = computed((): IconClass => {
const provider = repoRef.value?.provider
if (!provider) return 'i-simple-icons:github'
return PROVIDER_ICONS[provider] ?? 'i-lucide:code'
Expand Down
6 changes: 6 additions & 0 deletions app/types/icon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type IconClass =
| `i-carbon:${string}`
| `i-lucide:${string}`
| `i-simple-icons:${string}`
| `i-svg-spinners:${string}`
| `i-custom:${string}`
1 change: 1 addition & 0 deletions app/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './icon'
export * from './navigation'
Loading