import cx from "classnames"; import React from "react"; export const cardColors = [ "background-primary", "background-secondary", "background-contrast", "background-accent", "background-accent1-blog", "background-accent2-blog", "fill-subtle", "fill-accent1", "fill-accent2", "fill-accent3", "fill-accent4", "fill-accent5", ] as const; export type CardColor = (typeof cardColors)[number]; export interface CardProps extends React.HTMLAttributes { /** Custom background color */ color?: CardColor; noBorder?: boolean; } export const CLASS_ROOT = "card"; const Card = React.forwardRef( ({ className, color = "background-primary", noBorder, ...other }, ref) => { const classes = cx( CLASS_ROOT, { [color]: color !== "background-primary" && color !== "background-contrast", [`${color} text-inverse`]: color === "background-contrast", [`${CLASS_ROOT}--no-border`]: noBorder, }, className, ); return
; }, ); Card.displayName = "Card"; export { Card };