diff --git a/app/components/Button/Base.vue b/app/components/Button/Base.vue index 48997ac550..1a321e888d 100644 --- a/app/components/Button/Base.vue +++ b/app/components/Button/Base.vue @@ -32,6 +32,10 @@ const props = withDefaults( ) const el = useTemplateRef('el') +const slots = defineSlots<{ + default?: () => unknown +}>() +const iconOnly = computed(() => !!props.classicon && !slots.default) const keyboardShortcutsEnabled = useKeyboardShortcuts() @@ -48,8 +52,14 @@ defineExpose({ :class="{ 'inline-flex': !block, 'flex': block, - 'text-sm px-4 py-2': size === 'md', - 'text-xs px-2 py-0.5': size === 'sm', + 'text-sm py-2': size === 'md' && !iconOnly, + 'text-sm p-2': size === 'md' && !!iconOnly, + 'px-4': size === 'md' && !classicon && !iconOnly, + 'ps-3 pe-4': size === 'md' && !!classicon && !iconOnly, + 'text-xs py-0.5': size === 'sm' && !iconOnly, + 'text-xs p-0.5': size === 'sm' && !!iconOnly, + 'px-2': size === 'sm' && !classicon && !iconOnly, + 'ps-1.5 pe-2': size === 'sm' && !!classicon && !iconOnly, 'bg-transparent text-fg hover:enabled:(bg-fg/10) focus-visible:enabled:(bg-fg/10) aria-pressed:(bg-fg/10 border-fg/20 hover:enabled:(bg-fg/20 text-fg/50))': variant === 'secondary', 'text-bg bg-fg hover:enabled:(bg-fg/50) focus-visible:enabled:(bg-fg/50) aria-pressed:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))': diff --git a/app/components/Link/Base.vue b/app/components/Link/Base.vue index 58043e8bc0..561273154c 100644 --- a/app/components/Link/Base.vue +++ b/app/components/Link/Base.vue @@ -66,6 +66,8 @@ const isLink = computed(() => props.variant === 'link') const isButton = computed(() => !isLink.value) const isButtonSmall = computed(() => props.size === 'sm' && !isLink.value) const isButtonMedium = computed(() => props.size === 'md' && !isLink.value) +const slots = useSlots() +const iconOnly = computed(() => !!props.classicon && !slots.default) const keyboardShortcutsEnabled = useKeyboardShortcuts() @@ -78,13 +80,21 @@ const keyboardShortcutsEnabled = useKeyboardShortcuts() 'inline-flex': !block, 'gap-x-1 items-center justify-center font-mono border border-transparent rounded-md': isButton, - 'text-sm px-4 py-2': isButtonMedium, - 'text-xs px-2 py-0.5': isButtonSmall, + 'text-sm py-2': isButtonMedium && !iconOnly, + 'text-sm p-2': isButtonMedium && !!iconOnly, + 'px-4': isButtonMedium && !classicon && !iconOnly, + 'ps-3 pe-4': isButtonMedium && !!classicon && !iconOnly, + 'text-xs py-0.5': isButtonSmall && !iconOnly, + 'text-xs p-0.5': isButtonSmall && !!iconOnly, + 'px-2': isButtonSmall && !classicon && !iconOnly, + 'ps-1.5 pe-2': isButtonSmall && !!classicon && !iconOnly, 'text-bg bg-fg-muted': variant === 'button-primary', 'bg-transparent text-fg-muted': variant === 'button-secondary', }" - > + > + - {{ $t('package.dependencies.view_vulnerabilities') }} - + /> - {{ $t('package.deprecated.label') }} - + /> - {{ $t('package.versions.view_all_versions') }} - + /> - {{ $t('package.downloads.community_distribution') }} - + />
diff --git a/app/components/Package/WeeklyDownloadStats.vue b/app/components/Package/WeeklyDownloadStats.vue index 6ed1514cd9..0f7877f5cd 100644 --- a/app/components/Package/WeeklyDownloadStats.vue +++ b/app/components/Package/WeeklyDownloadStats.vue @@ -343,11 +343,10 @@ const config = computed(() => { variant="button-secondary" :to="trendsRoute" class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1 focus-visible:outline-accent/70 rounded" + :aria-label="$t('package.trends.title')" :title="$t('package.trends.title')" classicon="i-lucide:chart-line" - > - {{ $t('package.trends.title') }} - + /> diff --git a/app/pages/index.vue b/app/pages/index.vue index 90d6e38879..9f81a477f2 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -73,7 +73,7 @@ defineOgImage('Splash.takumi', {}, { alt: () => $t('seo.home.description') })