import React from "react"; import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui"; import { styled, theme } from "../theme"; import type * as WPDS from "../theme"; const NAME = "NavigationMenuLink"; const StyledNavigationMenuLink = styled(NavigationMenuPrimitive.Link, { color: theme.colors.disabled, display: "block", fontFamily: theme.fonts.meta, fontSize: theme.fontSizes["100"], padding: theme.space["050"], pointerEvents: "none", textDecoration: "none", "&:link, &:visited": { color: theme.colors.primary, pointerEvents: "auto", }, "&:hover": { color: theme.colors.accessible, }, "&[data-active]": { fontWeight: theme.fontWeights.bold, }, }); export type NavigationMenuLinkProps = { /** Any React node may be used as a child to allow for formatting */ children?: React.ReactNode; /** Override CSS */ css?: WPDS.CSS; } & React.ComponentPropsWithRef; export const NavigationMenuLink = React.forwardRef< HTMLAnchorElement, NavigationMenuLinkProps >(({ children, ...props }, ref) => { return ( <> {props.asChild ? ( {children} ) : ( {children} )} ); }); NavigationMenuLink.displayName = NAME;