import React from "react" import * as cn from "./GuideCard.styles"; import { Icon } from "../Icon" /** * Props for the GuideCard component */ export interface GuideCardProps { /** Content to be displayed in the card body */ children: React.ReactNode; /** URL the card links to */ href: string /** Title displayed at the top of the card */ title?: string; /** Optional icon displayed to the left of the content */ icon?: React.ReactNode | string; /** Visual style variant of the card */ kind?: "secondary" /** Size variant of the card */ size?: "sm" | "md" /** Additional CSS class names to apply to the card */ className?: string /** Additional props to pass to the link element */ as?: React.ElementType } /** * A card component that displays content with a title and optional icon. * The entire card is clickable and links to the specified URL. * * @category Component */ export function GuideCard({ children, href, icon, title, kind, size, className, as, }: GuideCardProps) { const Link = as || $Link const iconElement = icon && typeof icon === 'string' ? : icon return
{iconElement &&
{iconElement}
}
{title && {title}}
{children}
} GuideCard.Title = function GuideCardTitle({ children }: { children: React.ReactNode }) { return
{children}
<$Pointer />
} /** * A container component for grouping multiple GuideCard components. * Provides consistent spacing and layout for a list of guide cards. */ GuideCard.List = function GuideCardList({ children }: { children: React.ReactNode }) { return {children} } /** * Internal component that renders the arrow pointer icon. */ function $Pointer() { return
} function $Link({ href, children, ...rest }) { return {children} }