import * as React from "react"; import Card, { CardProps } from "./Card"; import { buttonCard, buttonCardActive, buttonCardDisabled, buttonCardDisabledActive, buttonCardFocused, buttonCardFocusedActive } from "../style"; import { cx } from "@emotion/css"; export interface ButtonCardProps extends CardProps { /** * Whether the component should look and act like a disabled element */ disabled?: boolean; /** * Whether the component is in the "on" state */ isActive?: boolean; /** * Whether the component is controlled by a checkbox or radio input */ isInput?: boolean; /** * Whether the component's child input has focus */ hasFocus?: boolean; /** * Allows custom styling */ className?: string; } const ButtonCard = ({ isActive, isInput, disabled, hasFocus, onClick, className, onKeyDown, "data-cy": dataCy = "buttonCard", ...other }: ButtonCardProps) => { const tabIndex = disabled ? -1 : 0; // mimic native