"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require('react');
require('./MessageBar.scss');
var css_1 = require('../../utilities/css');
var MessageBar_Props_1 = require('./MessageBar.Props');
var _instance = 0;
var MessageBar = (function (_super) {
    __extends(MessageBar, _super);
    function MessageBar(props) {
        _super.call(this, props);
        this.ICON_MAP = (_a = {},
            _a[MessageBar_Props_1.MessageBarType.info] = 'infoCircle',
            _a[MessageBar_Props_1.MessageBarType.warning] = 'infoCircle',
            _a[MessageBar_Props_1.MessageBarType.error] = 'xCircle',
            _a[MessageBar_Props_1.MessageBarType.remove] = 'circle',
            _a[MessageBar_Props_1.MessageBarType.severeWarning] = 'alert',
            _a[MessageBar_Props_1.MessageBarType.success] = 'checkboxCheck ms-Icon--circle',
            _a
        );
        this.state = {
            labelId: "MessageBar-" + _instance++,
        };
        var _a;
    }
    MessageBar.prototype.render = function () {
        var _a = this.props, messageBarType = _a.messageBarType, children = _a.children, actions = _a.actions;
        var labelId = this.state.labelId;
        var className = css_1.css(this.props.className, 'ms-MessageBar', {
            'ms-MessageBar': messageBarType === MessageBar_Props_1.MessageBarType.info,
            'ms-MessageBar--error': messageBarType === MessageBar_Props_1.MessageBarType.error,
            'ms-MessageBar--remove': messageBarType === MessageBar_Props_1.MessageBarType.remove,
            'ms-MessageBar--severeWarning': messageBarType === MessageBar_Props_1.MessageBarType.severeWarning,
            'ms-MessageBar--success': messageBarType === MessageBar_Props_1.MessageBarType.success,
            'ms-MessageBar--warning': messageBarType === MessageBar_Props_1.MessageBarType.warning
        });
        var iconSpan = React.createElement("div", {className: 'ms-MessageBar-icon'}, React.createElement("i", {className: "ms-Icon ms-Icon--" + this.ICON_MAP[messageBarType]}));
        return (React.createElement("div", {className: className, role: 'status', "aria-live": 'polite', tabIndex: 0, "aria-controls": 'ms-MessageBar-text'}, React.createElement("div", {className: 'ms-MessageBar-content'}, iconSpan, React.createElement("div", {className: 'ms-MessageBar-text', id: labelId}, React.createElement("div", {className: 'ms-MessageBar-actions'}, actions), children))));
    };
    MessageBar.defaultProps = {
        messageBarType: MessageBar_Props_1.MessageBarType.info
    };
    return MessageBar;
}(React.Component));
exports.MessageBar = MessageBar;

//# sourceMappingURL=MessageBar.js.map
