UNPKG

react-sleek

Version:

React Sleek Component Library

52 lines (51 loc) 1.91 kB
"use strict"; 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 Colors_1 = require("../../Style/Colors"); var Spacings_1 = require("../../Style/Spacings"); var csx_1 = require("csx"); var Label = /** @class */ (function (_super) { __extends(Label, _super); function Label() { return _super !== null && _super.apply(this, arguments) || this; } Label.prototype.render = function () { var styleProps = { color: this.props.tintColor, }; var labelStyle = typestyle_1.style(styleProps); return (React.createElement("label", { className: styles.labelBase }, React.createElement("span", { className: typestyle_1.classes(styles.labelText, labelStyle) }, this.props.text), this.props.children)); }; Label.defaultProps = { tintColor: Colors_1.default.White, }; return Label; }(React.PureComponent)); exports.default = Label; var styles = { labelBase: typestyle_1.style({ display: 'block', marginBottom: csx_1.px(Spacings_1.default.Compact), }), labelText: typestyle_1.style({ display: 'block', fontSize: csx_1.px(18), marginBottom: csx_1.px(Spacings_1.default.Tight), }), };