@@ -20,6 +20,7 @@ export const style = cva("transition-colors gap-2", {
2020 }
2121 } ,
2222 defaultVariants : {
23+ color : "primary" ,
2324 underline : false
2425 }
2526} ) ;
@@ -28,13 +29,14 @@ export type VariantProps = GetVariantProps<typeof style>;
2829
2930type LinkProps = {
3031 underline ?: boolean ;
32+ nofollow ?: boolean ;
3133 external ?: boolean ;
32- } & RequiredKeys < VariantProps , "color" >
34+ } & VariantProps
3335 & Omit < React . AnchorHTMLAttributes < HTMLAnchorElement > , keyof InternalLinkProps >
3436 & InternalLinkProps
3537 & React . RefAttributes < HTMLAnchorElement > ;
3638
37- const Link = ( { className, color, underline, children, external, hrefLang = "en" , rel, ...props } : LinkProps ) => {
39+ const Link = ( { className, color, underline, children, external, nofollow , hrefLang = "en" , rel, ...props } : LinkProps ) => {
3840
3941 const computedClassName = useMemo (
4042 ( ) => twMerge ( style ( { color, underline } ) , className ) ,
@@ -45,13 +47,13 @@ const Link = ({ className, color, underline, children, external, hrefLang = "en"
4547 < InternalLink
4648 className = { computedClassName }
4749 hrefLang = { hrefLang }
48- rel = { `${ external ? "external" : "" } ${ rel ?? "" } ` }
50+ rel = { `${ external ? "external opener " : "" } ${ nofollow ? "nofollow" : "" } ${ rel ?? "" } ` . trim ( ) }
4951 target = { external ? "_blank" : undefined }
5052 { ...props }
5153 >
5254 { children }
5355 { external && < ArrowTopRightOnSquareIcon
54- className = "inline w-4 h-4 "
56+ className = "inline-block w-[1em] h-[1em] "
5557 /> }
5658 </ InternalLink >
5759 ) ;
0 commit comments