react-sleek
Version:
React Sleek Component Library
58 lines (57 loc) • 2.15 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var typestyle_1 = require("typestyle");
var csx_1 = require("csx");
var Colors_1 = require("../../../Style/Colors");
var ProgressBar = /** @class */ (function (_super) {
__extends(ProgressBar, _super);
function ProgressBar() {
return _super !== null && _super.apply(this, arguments) || this;
}
ProgressBar.prototype.render = function () {
var progressBarStyle = typestyle_1.style({
backgroundColor: this.props.baseColor,
});
var progressStyle = typestyle_1.style({
backgroundColor: this.props.tintColor,
width: csx_1.percent(this.props.percentage),
});
return (React.createElement("div", { className: typestyle_1.classes(styles.progressBar, progressBarStyle) },
React.createElement("div", { className: typestyle_1.classes(styles.progress, progressStyle) })));
};
ProgressBar.defaultProps = {
baseColor: Colors_1.default.LightGrey,
tintColor: Colors_1.default.Blue,
percentage: 0,
};
return ProgressBar;
}(React.PureComponent));
exports.default = ProgressBar;
var styles = {
progressBar: typestyle_1.style({
userSelect: 'none',
flex: 1,
width: csx_1.percent(100),
borderRadius: csx_1.px(11),
height: csx_1.px(22),
}),
progress: typestyle_1.style({
userSelect: 'none',
borderRadius: csx_1.px(11),
height: csx_1.px(22),
}),
};