playtpus_ui
Version:
React Component Libary
40 lines • 2.26 kB
JavaScript
;
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Header = void 0;
var styled_components_1 = __importDefault(require("styled-components"));
var react_1 = __importDefault(require("react"));
var generator_1 = require("../generator");
var config_1 = require("../../config");
var HeaderLayout = styled_components_1.default.h1(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n", "\n", ""], ["\n", "\n", ""])), function (props) { return generator_1.sizeStyle(props.styleProps); }, function (props) { return generator_1.fontStyle(props.fontProps, false); });
exports.Header = function (props) {
var children = props.children, style = props.style, className = props.className, onClick = props.onClick;
var width = props.width, height = props.height, max = props.max, padding = props.padding, margin = props.margin, minWidth = props.minWidth, inverted = props.inverted;
var styleProps = {
width: width,
height: height,
max: max,
padding: padding,
margin: margin,
minWidth: minWidth
};
var defaultColor = inverted ? config_1.invertedTxtColor : config_1.primaryTxtColor;
var size = props.size, _a = props.color, color = _a === void 0 ? defaultColor : _a, bold = props.bold, textAlign = props.textAlign, placeSelf = props.placeSelf, textShadow = props.textShadow;
var fontProps = {
size: typeof size === 'number' ? (6 - size) / 2 + "rem" : size ? size : "1.5em",
color: color,
bold: bold,
textAlign: textAlign,
placeSelf: placeSelf,
textShadow: textShadow
};
return (react_1.default.createElement(HeaderLayout, { styleProps: styleProps, fontProps: fontProps, onClick: onClick, className: className, style: style }, children));
};
var templateObject_1;
//# sourceMappingURL=index.js.map