// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React, { forwardRef, HTMLAttributes } from 'react'; import { BaseProps } from '../Base'; import { StyledButton } from './Styled'; export interface ButtonProps extends Omit, 'css'>, BaseProps { /** The icon element to be shown in the button. */ icon?: JSX.Element; /** The text of the button. */ label: string; /** The variant of button. */ variant?: ButtonVariant; /** Whether or not the button is selected. */ selected?: boolean; /** Defines the size of the icon in the button, it defaults to `sm`. */ iconSize?: IconSize; /** Whether or not the button is disabled. **/ disabled?: boolean; } export type IconSize = 'sm' | 'md' | 'lg'; export type ButtonVariant = 'default' | 'primary' | 'secondary' | 'icon'; export const Button = forwardRef( (props: ButtonProps, ref: React.Ref) => ( {props.icon && ( {props.icon} )} {props.label} ) ); export default Button;