"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var Spinner_Props_1 = require("./Spinner.Props");
var stylesImport = require("./Spinner.scss");
var styles = stylesImport;
var Spinner = (function (_super) {
    tslib_1.__extends(Spinner, _super);
    function Spinner() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Spinner.prototype.render = function () {
        var _a = this.props, type = _a.type, size = _a.size, label = _a.label, className = _a.className, ariaLive = _a.ariaLive, ariaLabel = _a.ariaLabel; // TODO remove deprecated type property at >= 2.0.0
        var statusMessage = ariaLabel || label;
        return (React.createElement("div", { className: Utilities_1.css('ms-Spinner', styles.root, className) },
            React.createElement("div", { className: Utilities_1.css('ms-Spinner-circle', styles.circle, (_b = {},
                    _b['ms-Spinner--xSmall ' + styles.circleIsXSmall] = size === Spinner_Props_1.SpinnerSize.xSmall,
                    _b['ms-Spinner--small ' + styles.circleIsSmall] = size === Spinner_Props_1.SpinnerSize.small,
                    _b['ms-Spinner--medium ' + styles.circleIsMedium] = size === Spinner_Props_1.SpinnerSize.medium,
                    _b['ms-Spinner--large ' + styles.circleIsLarge] = size === Spinner_Props_1.SpinnerSize.large,
                    _b['ms-Spinner--normal ' + styles.circleIsTypeMedium] = type === Spinner_Props_1.SpinnerType.normal,
                    _b['ms-Spinner--large ' + styles.circleIsTypeLarge] = type === Spinner_Props_1.SpinnerType.large // TODO remove deprecated value at >= 2.0.0
                ,
                    _b)) }),
            label && React.createElement("div", { className: Utilities_1.css('ms-Spinner-label', styles.label) }, label),
            statusMessage &&
                React.createElement("div", { role: 'status', "aria-live": this.props.ariaLive },
                    React.createElement(Utilities_1.DelayedRender, null,
                        React.createElement("div", { className: styles.screenReaderOnly }, statusMessage)))));
        var _b;
    };
    return Spinner;
}(Utilities_1.BaseComponent));
Spinner.defaultProps = {
    size: Spinner_Props_1.SpinnerSize.medium,
    ariaLive: 'polite'
};
exports.Spinner = Spinner;

//# sourceMappingURL=Spinner.js.map
