UNPKG

glass-app-manager

Version:

Informatica's Glass Framework CLI for bootstrapping

28 lines (21 loc) 767 B
// @flow import * as React from "react"; import classNames from "classnames"; import { wrapTextNode } from "../../utils/common"; import BaseButton, { type Props as BaseButtonProps } from "./BaseButton"; type Props = { ...BaseButtonProps, /** * The variant of the button. */ variant?: "primary" | "secondary" | "call-to-action" | "ghost", }; const Button = React.forwardRef(({ className, children, variant = "secondary", ...rest }: Props, ref) => { return ( <BaseButton className={classNames("button", `button--${variant}`, className)} {...rest} ref={ref}> {React.Children.map(children, wrapTextNode)} </BaseButton> ); }); Button.displayName = "Button"; export default Button;