|
|
@@ -119,41 +119,41 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP |
|
|
|
href={disabled ? undefined : href as string} |
|
|
|
type={disabled ? 'button' : undefined} |
|
|
|
ref={forwardedRef} |
|
|
|
className={tw( |
|
|
|
'items-center justify-center rounded overflow-hidden ring-secondary/50 leading-none select-none no-underline m-0', |
|
|
|
'focus:outline-0 focus:ring-4', |
|
|
|
'active:ring-tertiary/50', |
|
|
|
'disabled:opacity-50 disabled:cursor-not-allowed', |
|
|
|
{ |
|
|
|
'flex w-full': block, |
|
|
|
'inline-flex max-w-full align-middle': !block, |
|
|
|
}, |
|
|
|
{ |
|
|
|
'pl-2 gap-2': compact, |
|
|
|
'pl-4 gap-4': !compact, |
|
|
|
'pr-4': !(compact || menuItem), |
|
|
|
'pr-2': compact || menuItem, |
|
|
|
}, |
|
|
|
{ |
|
|
|
'border-2 border-primary focus:border-secondary active:border-tertiary disabled:border-primary': variant !== 'bare', |
|
|
|
'bg-negative text-primary focus:text-secondary active:text-tertiary disabled:text-primary': variant !== 'filled', |
|
|
|
'bg-primary text-negative focus:bg-secondary active:bg-tertiary focus:text-negative active:text-negative disabled:bg-primary': variant === 'filled', |
|
|
|
}, |
|
|
|
{ |
|
|
|
'h-10': size === 'small', |
|
|
|
'h-12': size === 'medium', |
|
|
|
'h-16': size === 'large', |
|
|
|
}, |
|
|
|
className, |
|
|
|
)} |
|
|
|
className={tw( |
|
|
|
'items-center justify-center rounded overflow-hidden ring-secondary/50 leading-none select-none relative', |
|
|
|
'focus:outline-0 focus:ring-4', |
|
|
|
'active:ring-tertiary/50', |
|
|
|
'disabled:opacity-50 disabled:cursor-not-allowed', |
|
|
|
'text-primary focus:text-secondary active:text-tertiary', |
|
|
|
{ |
|
|
|
'flex w-full': block, |
|
|
|
'inline-flex max-w-full align-middle': !block, |
|
|
|
}, |
|
|
|
{ |
|
|
|
'pl-2 gap-2': compact, |
|
|
|
'pl-4 gap-4': !compact, |
|
|
|
'pr-4': !(compact || menuItem), |
|
|
|
'pr-2': compact || menuItem, |
|
|
|
}, |
|
|
|
{ |
|
|
|
'bg-current': variant === 'filled', |
|
|
|
}, |
|
|
|
{ |
|
|
|
'h-10': size === 'small', |
|
|
|
'h-12': size === 'medium', |
|
|
|
'h-16': size === 'large', |
|
|
|
}, |
|
|
|
className, |
|
|
|
)} |
|
|
|
data-testid="link" |
|
|
|
style={style} |
|
|
|
> |
|
|
|
<span |
|
|
|
data-testid="childrenParent" |
|
|
|
className={tw( |
|
|
|
'flex-auto min-w-0 flex items-center gap-2', |
|
|
|
'flex-auto min-w-0 flex items-center gap-2 relative', |
|
|
|
iconAfterChildren ? 'flex-row-reverse' : 'flex-row', |
|
|
|
variant === 'filled' && 'text-negative', |
|
|
|
)} |
|
|
|
> |
|
|
|
{icon && ( |
|
|
@@ -206,6 +206,10 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP |
|
|
|
</span> |
|
|
|
<span |
|
|
|
data-testid="badge" |
|
|
|
className={tw( |
|
|
|
'relative', |
|
|
|
variant === 'filled' && 'text-negative', |
|
|
|
)} |
|
|
|
> |
|
|
|
{badge} |
|
|
|
</span> |
|
|
@@ -214,6 +218,10 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP |
|
|
|
{menuItem && ( |
|
|
|
<span |
|
|
|
data-testid="menuItemIndicator" |
|
|
|
className={tw( |
|
|
|
'relative', |
|
|
|
variant === 'filled' && 'text-negative', |
|
|
|
)} |
|
|
|
> |
|
|
|
<svg |
|
|
|
className="w-6 h-6 fill-none stroke-current stroke-2 linejoin-round linecap-round" |
|
|
@@ -224,6 +232,14 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP |
|
|
|
</svg> |
|
|
|
</span> |
|
|
|
)} |
|
|
|
{ |
|
|
|
variant !== 'bare' |
|
|
|
&& ( |
|
|
|
<span |
|
|
|
className="border-current border-2 rounded-inherit absolute w-full h-full top-0 left-0" |
|
|
|
/> |
|
|
|
) |
|
|
|
} |
|
|
|
</Component> |
|
|
|
); |
|
|
|
}); |
|
|
|