"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const styles_1 = require("./styles");
const Button = ({ id, children, onPress, accessibility, accessibilityLabel, testID, style = [{}], textStyle = {}, disabled = false, rounded = false, loading = false, contrast = false, flat = false, variant = 'filled', colorVariant = 'primary', typographyVariant = 'md', minWidth, maxWidth, rightIconName, leftIconName, leftIconTouchable = true, rightIconTouchable = true, }) => {
    return (<styles_1.Touchable id={id || accessibility} accessibility={accessibility} accessibilityLabel={accessibilityLabel || accessibility} testID={testID || id || accessibility} disabled={loading || disabled} onPress={onPress} rounded={rounded}>
      <styles_1.ButtonWrapper hasBorder={variant === 'outline'} buttonVariant={variant} colorVariant={colorVariant} style={style} disabled={disabled} rounded={rounded} minWidth={minWidth} maxWidth={maxWidth} flat={flat}>
        {loading && <styles_1.Loading contrast={contrast}/>}
        {!loading && (<>
            {!!leftIconName && (<styles_1.Icon accessibility="" name={leftIconName} buttonVariant={variant} colorVariant={colorVariant} style={style} touchable={leftIconTouchable} leftIcon/>)}
            <styles_1.TextButton style={textStyle} disabled={disabled} flat={flat} colorVariant={colorVariant} variant={typographyVariant} buttonVariant={variant}>
              {children}
            </styles_1.TextButton>
            {!!rightIconName && (<styles_1.Icon accessibility="" name={rightIconName} colorVariant={colorVariant} buttonVariant={variant} style={style} touchable={rightIconTouchable} rightIcon/>)}
          </>)}
      </styles_1.ButtonWrapper>
    </styles_1.Touchable>);
};
exports.default = Button;
//# sourceMappingURL=index.js.map