Add more comments

This commit is contained in:
Robin
2024-09-12 12:59:02 -04:00
parent e5e6233efb
commit 3ded8bec47
2 changed files with 8 additions and 0 deletions

View File

@@ -6,5 +6,8 @@ Please see LICENSE in the repository root for full details.
*/ */
.external { .external {
/* By default links will be blue/purple (or whatever the user agent does), but
in our designs we generally want external links to be the same color as the
surrounding text */
color: inherit; color: inherit;
} }

View File

@@ -48,6 +48,7 @@ type Props = Omit<
/** /**
* A version of Compound's link component that integrates with our router setup. * A version of Compound's link component that integrates with our router setup.
* This is only for app-internal links.
*/ */
export const Link = forwardRef<HTMLAnchorElement, Props>(function Link( export const Link = forwardRef<HTMLAnchorElement, Props>(function Link(
{ to, state, ...props }, { to, state, ...props },
@@ -57,6 +58,10 @@ export const Link = forwardRef<HTMLAnchorElement, Props>(function Link(
return <CpdLink ref={ref} {...props} href={path} onClick={onClick} />; return <CpdLink ref={ref} {...props} href={path} onClick={onClick} />;
}); });
/**
* A link to an external web page, made to fit into blocks of text more subtly
* than the normal Compound link component.
*/
export const ExternalLink = forwardRef< export const ExternalLink = forwardRef<
HTMLAnchorElement, HTMLAnchorElement,
ComponentPropsWithoutRef<"a"> ComponentPropsWithoutRef<"a">