@visa/nova-react
Version:
Visa Product Design System Nova React library. Compatible with React ^19.
42 lines (41 loc) • 1.68 kB
TypeScript
import { type ComponentPropsWithRef, type ElementType, type ReactElement } from 'react';
type ButtonCustomProps<ET extends ElementType = 'button'> = {
/** Alternate color scheme */
alternate?: boolean;
/** Size of Button */
buttonSize?: 'large' | 'medium' | 'small';
/** Color Scheme of Button */
colorScheme?: 'primary' | 'secondary' | 'tertiary';
/** Destructive Button */
destructive?: boolean;
/** Icon Button */
iconButton?: boolean;
/** Icon Two Button */
iconTwoColor?: boolean;
/** Stacked Button */
stacked?: boolean;
/** Subtle Button */
subtle?: boolean;
} & Omit<ComponentPropsWithRef<ET>, ''>;
export type ButtonProperties<ET extends ElementType = 'button'> = ButtonCustomProps & ({
/** Cloned Element (not compatible with tag property) */
element?: never;
/** Tag (not compatible with element property) */
tag?: ElementType;
} | {
/** Cloned Element (not compatible with tag property) */
element?: ReactElement<ButtonCustomProps<ET>>;
/** Tag (not compatible with element property) */
tag?: never;
}) & Omit<ComponentPropsWithRef<ET>, ''>;
/**
* Interactive elements enabling users to take actions within an interface.
* @docs {@link https://design.visa.com/components/button/?code_library=react | See Docs}
* @vgar TODO
* @wcag TODO
*/
declare const Button: {
<ET extends ElementType = "button">({ alternate, buttonSize, className, colorScheme, destructive, element, iconButton, iconTwoColor, stacked, subtle, tag: Tag, ...remainingProps }: ButtonProperties<ET>): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export default Button;