@@ -10,7 +10,7 @@ const props = withDefaults(
1010 * `type` should never be used, because this will always be a link.
1111 * */
1212 ' type' ?: never
13- ' variant' ?: ' button-primary' | ' button-secondary' | ' link'
13+ ' variant' ?: ' button-primary' | ' button-secondary' | ' link' | ' link-block '
1414 ' size' ?: ' small' | ' medium'
1515
1616 ' keyshortcut' ?: string
@@ -52,17 +52,20 @@ const isLinkAnchor = computed(
5252)
5353
5454/** size is only applicable for button like links */
55- const isLink = computed (() => props .variant === ' link' )
56- const isButton = computed (() => props .variant !== ' link' )
57- const isButtonSmall = computed (() => props .size === ' small' && props .variant !== ' link' )
58- const isButtonMedium = computed (() => props .size === ' medium' && props .variant !== ' link' )
55+ const isLink = computed (() => props .variant === ' link' || props .variant === ' link-block' )
56+ const isButton = computed (() => ! isLink .value )
57+ const isButtonSmall = computed (() => props .size === ' small' && ! isLink .value )
58+ const isButtonMedium = computed (() => props .size === ' medium' && ! isLink .value )
59+ const isBlock = computed (() => isButton || props .variant === ' link-block' )
5960 </script >
6061
6162<template >
6263 <span
6364 v-if =" disabled"
6465 :class =" {
65- 'opacity-50 inline-flex gap-x-1 items-center justify-center font-mono border border-transparent rounded-md':
66+ 'flex': isBlock,
67+ 'inline-flex': !isBlock,
68+ 'opacity-50 gap-x-1 items-center justify-center font-mono border border-transparent rounded-md':
6669 isButton,
6770 'text-sm px-4 py-2': isButtonMedium,
6871 'text-xs px-2 py-0.5': isButtonSmall,
@@ -73,8 +76,10 @@ const isButtonMedium = computed(() => props.size === 'medium' && props.variant !
7376 /></span >
7477 <NuxtLink
7578 v-else
76- class =" group/link inline-flex gap-x-1 items-center justify-center"
79+ class =" group/link gap-x-1 items-center justify-center"
7780 :class =" {
81+ 'flex': isBlock,
82+ 'inline-flex': !isBlock,
7883 'underline-offset-[0.2rem] underline decoration-1 decoration-fg/30': !isLinkAnchor && isLink,
7984 'font-mono text-fg hover:(decoration-accent text-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200':
8085 isLink,
0 commit comments