import React, { Component, } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import makeId from '../../Form/form_row/make_id';
import { SoftIcon } from '../../Icon';
export class SoftSwitch extends Component {
    constructor(props) {
        super(props);
        this.state = {
            switchId: this.props.id || makeId(),
        };
    }
    render() {
        const { label, id, // eslint-disable-line no-unused-vars
        name, checked, disabled, compressed, onChange, className, ...rest } = this.props;
        const { switchId } = this.state;
        const classes = classNames('softSwitch', {
            'softSwitch--compressed': compressed,
        }, className);
        return (React.createElement("div", { className: classes },
            React.createElement("input", Object.assign({ className: "softSwitch__input", name: name, id: switchId, type: "checkbox", checked: checked, disabled: disabled, onChange: onChange }, rest)),
            React.createElement("span", { className: "softSwitch__body" },
                React.createElement("span", { className: "softSwitch__thumb" }),
                React.createElement("span", { className: "softSwitch__track" },
                    React.createElement(SoftIcon, { type: "cross", size: "m", className: "softSwitch__icon" }),
                    React.createElement(SoftIcon, { type: "check", size: "m", className: "softSwitch__icon softSwitch__icon--checked" }))),
            label && (React.createElement("label", { className: "softSwitch__label", htmlFor: switchId }, label))));
    }
}
SoftSwitch.propTypes = {
    name: PropTypes.string,
    id: PropTypes.string,
    label: PropTypes.node,
    checked: PropTypes.bool,
    onChange: PropTypes.func,
    disabled: PropTypes.bool,
    compressed: PropTypes.bool
};
//# sourceMappingURL=SoftSwitch.js.map