@@ -3,6 +3,7 @@ import { NuxtLink } from '#components'
33
44const props = defineProps <{
55 packageName: string
6+ isBinary? : boolean
67 version? : string
78}>()
89
@@ -43,7 +44,7 @@ const typesTooltip = computed(() => {
4344
4445const typesHref = computed (() => {
4546 if (! analysis .value ) return null
46- if (analysis .value .types .kind === ' @types' ) {
47+ if (analysis .value .types ? .kind === ' @types' ) {
4748 return ` /${analysis .value .types .packageName } `
4849 }
4950 return null
@@ -53,59 +54,62 @@ const typesHref = computed(() => {
5354<template >
5455 <ul v-if =" analysis" class =" flex items-center gap-1.5 list-none m-0 p-0" >
5556 <!-- TypeScript types badge -->
56- <li >
57- <component
58- :is =" typesHref ? NuxtLink : 'span'"
59- :to =" typesHref"
60- class =" inline-flex items-center gap-1 px-1.5 py-0.5 font-mono text-xs rounded transition-colors duration-200"
61- :class =" [
62- hasTypes
63- ? 'text-fg-muted bg-bg-muted border border-border'
64- : 'text-fg-subtle bg-bg-subtle border border-border-subtle',
65- typesHref
66- ? 'hover:text-fg hover:border-border-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50'
67- : '',
68- ]"
69- :title =" typesTooltip"
70- >
71- <span
72- class =" w-3 h-3"
73- :class =" hasTypes ? 'i-carbon-checkmark' : 'i-carbon-close'"
74- aria-hidden =" true"
75- />
76- {{ $t('package.metrics.types_label') }}
77- </component >
57+ <li v-if =" !props.isBinary" >
58+ <AppTooltip :text =" typesTooltip" >
59+ <component
60+ :is =" typesHref ? NuxtLink : 'span'"
61+ :to =" typesHref"
62+ class =" inline-flex items-center gap-1 px-1.5 py-0.5 font-mono text-xs rounded transition-colors duration-200"
63+ :class =" [
64+ hasTypes
65+ ? 'text-fg-muted bg-bg-muted border border-border'
66+ : 'text-fg-subtle bg-bg-subtle border border-border-subtle',
67+ typesHref
68+ ? 'hover:text-fg hover:border-border-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50'
69+ : '',
70+ ]"
71+ >
72+ <span
73+ class =" w-3 h-3"
74+ :class =" hasTypes ? 'i-carbon-checkmark' : 'i-carbon-close'"
75+ aria-hidden =" true"
76+ />
77+ {{ $t('package.metrics.types_label') }}
78+ </component >
79+ </AppTooltip >
7880 </li >
7981
8082 <!-- ESM badge (show with X if missing) -->
8183 <li >
82- <span
83- class =" inline-flex items-center gap-1 px-1.5 py-0.5 font-mono text-xs rounded transition-colors duration-200"
84- :class ="
85- hasEsm
86- ? 'text-fg-muted bg-bg-muted border border-border'
87- : 'text-fg-subtle bg-bg-subtle border border-border-subtle'
88- "
89- :title =" hasEsm ? $t('package.metrics.esm') : $t('package.metrics.no_esm')"
90- >
84+ <AppTooltip :text =" hasEsm ? $t('package.metrics.esm') : $t('package.metrics.no_esm')" >
9185 <span
92- class =" w-3 h-3"
93- :class =" hasEsm ? 'i-carbon-checkmark' : 'i-carbon-close'"
94- aria-hidden =" true"
95- />
96- ESM
97- </span >
86+ class =" inline-flex items-center gap-1 px-1.5 py-0.5 font-mono text-xs rounded transition-colors duration-200"
87+ :class ="
88+ hasEsm
89+ ? 'text-fg-muted bg-bg-muted border border-border'
90+ : 'text-fg-subtle bg-bg-subtle border border-border-subtle'
91+ "
92+ >
93+ <span
94+ class =" w-3 h-3"
95+ :class =" hasEsm ? 'i-carbon-checkmark' : 'i-carbon-close'"
96+ aria-hidden =" true"
97+ />
98+ ESM
99+ </span >
100+ </AppTooltip >
98101 </li >
99102
100103 <!-- CJS badge (only show if present) -->
101104 <li v-if =" hasCjs" >
102- <span
103- class =" inline-flex items-center gap-1 px-1.5 py-0.5 font-mono text-xs text-fg-muted bg-bg-muted border border-border rounded transition-colors duration-200"
104- :title =" $t('package.metrics.cjs')"
105- >
106- <span class =" i-carbon-checkmark w-3 h-3" aria-hidden =" true" />
107- CJS
108- </span >
105+ <AppTooltip :text =" $t('package.metrics.cjs')" >
106+ <span
107+ class =" inline-flex items-center gap-1 px-1.5 py-0.5 font-mono text-xs text-fg-muted bg-bg-muted border border-border rounded transition-colors duration-200"
108+ >
109+ <span class =" i-carbon-checkmark w-3 h-3" aria-hidden =" true" />
110+ CJS
111+ </span >
112+ </AppTooltip >
109113 </li >
110114 </ul >
111115</template >
0 commit comments