import React from 'react';
import PropTypes from 'prop-types';
import { SoftRadio } from './SoftRadio';
export const SoftRadioGroup = ({ options, idSelected, onChange, name, className, disabled, compressed, ...rest }) => (React.createElement("div", Object.assign({ className: className }, rest), options.map((option, index) => {
    const { disabled: isOptionDisabled, ...optionRest } = option;
    return (React.createElement(SoftRadio, Object.assign({ className: "softRadioGroup__item", key: index, name: name, checked: option.id === idSelected, disabled: disabled || isOptionDisabled, onChange: onChange.bind(null, option.id, option.value), compressed: compressed }, optionRest)));
})));
// @ts-ignore
SoftRadioGroup.propTypes = {
    disabled: PropTypes.bool,
    name: PropTypes.string,
    options: PropTypes.arrayOf(PropTypes.shape({
        id: PropTypes.string.isRequired,
        label: PropTypes.node,
        value: PropTypes.string,
        disabled: PropTypes.bool,
    })).isRequired,
    idSelected: PropTypes.string,
    onChange: PropTypes.func.isRequired,
    /**
     * Tightens up the spacing between radio rows and sends down the
     * compressed prop to the radio itself
     */
    compressed: PropTypes.bool,
};
// @ts-ignore
SoftRadioGroup.defaultProps = {
    options: [],
};
//# sourceMappingURL=SoftRadioGroup.js.map