@arconnect/components
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -54,6 +54,6 @@ "use strict"; | ||
}, [title, subtitle, heading]); | ||
var TextElement = (0, react_1.useMemo)(function () { return styled_components_1.default[tag](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n "], ["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n "])), sizes[tag], function (props) { return tag === "p" ? props.theme.secondaryText : props.theme.primaryText; }, tag === "p" ? "500" : "700"); }, [tag]); | ||
return ((0, jsx_runtime_1.jsx)(TextElement, __assign({}, props, { children: children }))); | ||
return ((0, jsx_runtime_1.jsx)(TextElement, __assign({ as: tag, size: tag }, props, { children: children }))); | ||
} | ||
exports.Text = Text; | ||
var TextElement = styled_components_1.default.p(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n"], ["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n"])), function (props) { return sizes[props.size]; }, function (props) { return props.size === "p" ? props.theme.secondaryText : props.theme.primaryText; }, function (props) { return props.size === "p" ? "500" : "700"; }); | ||
var templateObject_1; |
@@ -48,5 +48,5 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
}, [title, subtitle, heading]); | ||
var TextElement = useMemo(function () { return styled[tag](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n "], ["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n "])), sizes[tag], function (props) { return tag === "p" ? props.theme.secondaryText : props.theme.primaryText; }, tag === "p" ? "500" : "700"); }, [tag]); | ||
return (_jsx(TextElement, __assign({}, props, { children: children }))); | ||
return (_jsx(TextElement, __assign({ as: tag, size: tag }, props, { children: children }))); | ||
} | ||
var TextElement = styled.p(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n"], ["\n font-size: ", ";\n color: rgb(", ");\n font-weight: ", ";\n margin-top: 0;\n"])), function (props) { return sizes[props.size]; }, function (props) { return props.size === "p" ? props.theme.secondaryText : props.theme.primaryText; }, function (props) { return props.size === "p" ? "500" : "700"; }); | ||
var templateObject_1; |
{ | ||
"name": "@arconnect/components", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
112078