import React from 'react';
import { ButtonWrapper, Icon, Loading, TextButton, Touchable } from './styles';
const Button = ({ id, children, onPress, accessibility, accessibilityLabel, testID, style = [{}], textStyle = {}, disabled = false, rounded = false, loading = false, contrast = false, flat = false, hasBorder = false, variant = 'primary', typographyVariant = 'md', minWidth, maxWidth, rightIconName, leftIconName, }) => {
    return (<Touchable id={id || accessibility} accessibility={accessibility} accessibilityLabel={accessibilityLabel || accessibility} testID={testID || id || accessibility} disabled={loading || disabled} onPress={onPress} rounded={rounded}>
      <ButtonWrapper hasBorder={hasBorder} buttonVariant={variant} style={style} disabled={disabled} rounded={rounded} minWidth={minWidth} maxWidth={maxWidth} flat={flat}>
        {loading && <Loading contrast={contrast}/>}
        {!loading && (<>
            {!!leftIconName && (<Icon accessibility="" name={leftIconName} buttonVariant={variant} style={style} leftIcon/>)}
            <TextButton style={textStyle} disabled={disabled} flat={flat} variant={typographyVariant} buttonVariant={variant}>
              {children}
            </TextButton>
            {!!rightIconName && (<Icon accessibility="" name={rightIconName} buttonVariant={variant} style={style} rightIcon/>)}
          </>)}
      </ButtonWrapper>
    </Touchable>);
};
export default Button;
//# sourceMappingURL=index.js.map