UNPKG

@up-group/react-controls

Version:

We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get

35 lines 2.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var themedComponents_1 = require("../../../Common/theming/themedComponents"); var styles_1 = require("../Paragraph/styles"); var utils_1 = require("../../../Common/utils"); var sizeMap = { h1: 36, h2: 30, h3: 24, h4: 18, h5: 16 }; var calculateSize = function (tag) { return utils_1.default(sizeMap[tag]); }; var truncateCss = function (truncate) { if (truncate) { return (_a = ["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n "], _a.raw = ["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n "], themedComponents_1.css(_a)); } return ''; var _a; }; var textTransformCss = function (upcase) { if (upcase) { return (_a = ["\n text-transform: uppercase;\n "], _a.raw = ["\n text-transform: uppercase;\n "], themedComponents_1.css(_a)); } return ''; var _a; }; var HeadingStyles = (_a = ["\n font-size: ", ";\n text-align: ", ";\n color: ", ";\n ", ";\n ", ";\n ", ";\n"], _a.raw = ["\n font-size: ", ";\n text-align: ", ";\n color: ", ";\n ", ";\n ", ";\n ", ";\n"], themedComponents_1.css(_a, function (props) { return calculateSize(props.tag); }, function (props) { return props.textAlign; }, function (props) { return props.color; }, function (props) { return truncateCss(props.truncate); }, function (props) { return textTransformCss(props.upcase); }, function (props) { return styles_1.marginCss(props.margin); })); exports.H1 = (_b = ["\n ", "\n"], _b.raw = ["\n ", "\n"], themedComponents_1.default.h1(_b, HeadingStyles)); exports.H2 = (_c = ["\n ", "\n"], _c.raw = ["\n ", "\n"], themedComponents_1.default.h2(_c, HeadingStyles)); exports.H3 = (_d = ["\n ", "\n"], _d.raw = ["\n ", "\n"], themedComponents_1.default.h3(_d, HeadingStyles)); exports.H4 = (_e = ["\n ", "\n"], _e.raw = ["\n ", "\n"], themedComponents_1.default.h4(_e, HeadingStyles)); exports.H5 = (_f = ["\n ", "\n"], _f.raw = ["\n ", "\n"], themedComponents_1.default.h5(_f, HeadingStyles)); var _a, _b, _c, _d, _e, _f; //# sourceMappingURL=styles.js.map