import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
export const SoftRadio = ({ className, id, name, checked, label, value, onChange, disabled, compressed, autoFocus, ...rest }) => {
    const classes = classNames('softRadio', {
        'softRadio--noLabel': !label,
        'softRadio--compressed': compressed,
    }, className);
    let optionalLabel;
    if (label) {
        optionalLabel = (React.createElement("label", { className: "softRadio__label", htmlFor: id }, label));
    }
    return (React.createElement("div", Object.assign({ className: classes }, rest),
        React.createElement("input", { className: "softRadio__input", type: "radio", id: id, name: name, value: value, checked: checked, onChange: onChange, disabled: disabled, autoFocus: autoFocus }),
        React.createElement("div", { className: "softRadio__circle" }),
        optionalLabel));
};
// @ts-ignore
SoftRadio.propTypes = {
    className: PropTypes.string,
    id: PropTypes.string.isRequired,
    checked: PropTypes.bool.isRequired,
    label: PropTypes.node,
    value: PropTypes.string,
    onChange: PropTypes.func.isRequired,
    disabled: PropTypes.bool,
    /**
     * when `true` creates a shorter height radio row
     */
    compressed: PropTypes.bool,
    autoFocus: PropTypes.bool,
};
// @ts-ignore
SoftRadio.defaultProps = {
    checked: false,
    disabled: false,
    compressed: false,
};
//# sourceMappingURL=SoftRadio.js.map