"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
            t[p] = s[p];
    }
    return t;
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
            t[p[i]] = s[p[i]];
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var react_1 = require("@storybook/react");
var styled_components_1 = require("styled-components");
var _1 = require("../");
var Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  margin: 30px;\n"], ["\n  margin: 30px;\n"])));
var Progressor = (function (_super) {
    __extends(Progressor, _super);
    function Progressor(props) {
        var _this = _super.call(this, props) || this;
        _this.state = {
            value: props.value
        };
        return _this;
    }
    Progressor.prototype.componentDidMount = function () {
        var _this = this;
        this.progressInterval = setInterval(function () {
            var value = _this.state.value + 1;
            if (value > 100) {
                value = 0;
            }
            _this.setState({ value: value });
        }, 250);
    };
    Progressor.prototype.componentWillUnmount = function () {
        window.clearInterval(this.progressInterval);
    };
    Progressor.prototype.render = function () {
        var _a = this.props, value = _a.value, other = __rest(_a, ["value"]);
        return (React.createElement(_1.ProgressBar, __assign({}, other, { value: this.state.value }),
            this.state.value,
            "%"));
    };
    return Progressor;
}(React.Component));
exports.Progressor = Progressor;
react_1.storiesOf('ProgressBar', module)
    .addWithInfo('Standard', function () {
    return (React.createElement(Container, null,
        React.createElement(Progressor, { mb: 3, primary: true, value: 50 }),
        React.createElement(Progressor, { mb: 3, secondary: true, value: 45 }),
        React.createElement(Progressor, { mb: 3, tertiary: true, value: 40 }),
        React.createElement(Progressor, { mb: 3, danger: true, value: 35 }),
        React.createElement(Progressor, { mb: 3, warning: true, value: 30 }),
        React.createElement(Progressor, { mb: 3, success: true, value: 25 }),
        React.createElement(Progressor, { mb: 3, info: true, value: 20 })));
})
    .addWithInfo('Emphasized', function () {
    return (React.createElement(Container, null,
        React.createElement(Progressor, { mb: 3, emphasized: true, primary: true, value: 50 }),
        React.createElement(Progressor, { mb: 3, emphasized: true, secondary: true, value: 45 }),
        React.createElement(Progressor, { mb: 3, emphasized: true, tertiary: true, value: 40 }),
        React.createElement(Progressor, { mb: 3, emphasized: true, danger: true, value: 35 }),
        React.createElement(Progressor, { mb: 3, emphasized: true, warning: true, value: 30 }),
        React.createElement(Progressor, { mb: 3, emphasized: true, success: true, value: 25 }),
        React.createElement(Progressor, { mb: 3, emphasized: true, info: true, value: 20 })));
});
var templateObject_1;
