import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { getSecureRelForTarget } from '../../services';
const colorsToClassNameMap = {
    'primary': 'softLink--primary',
    'subdued': 'softLink--subdued',
    'secondary': 'softLink--secondary',
    'accent': 'softLink--accent',
    'danger': 'softLink--danger',
    'warning': 'softLink--warning',
    'ghost': 'softLink--ghost',
    'text': 'softLink--text',
};
export const SOFT_LINK_COLORS = Object.keys(colorsToClassNameMap);
export class SoftLink extends Component {
    render() {
        let { children, color = '', className, href, target, rel, type, onClick, ...rest } = this.props;
        const classes = classNames('softLink', colorsToClassNameMap[color], className);
        if (href === undefined) {
            return (React.createElement("button", Object.assign({ className: classes, type: type, onClick: onClick }, rest), children));
        }
        const secureRel = getSecureRelForTarget({ href, target, rel });
        return (React.createElement("a", Object.assign({ className: classes, href: href, target: target, rel: secureRel, onClick: onClick }, rest), children));
    }
}
SoftLink.defaultProps = { color: '' };
SoftLink.defaultProps = {
    color: ''
};
SoftLink.propTypes = {
    children: PropTypes.oneOfType([
        PropTypes.string,
        PropTypes.element
    ]),
    color: PropTypes.string,
    className: PropTypes.string,
    href: PropTypes.string,
    target: PropTypes.string,
    rel: PropTypes.string,
    type: PropTypes.string,
    onClick: PropTypes.func,
};
//# sourceMappingURL=SoftLink.js.map