@pubsweet/ui
Version:
React component library for use in pubsweet apps
94 lines (66 loc) • 3.94 kB
JavaScript
;
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _uiToolkit = require("@pubsweet/ui-toolkit");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _templateObject6() {
var data = _taggedTemplateLiteral(["\n ", ";\n "]);
_templateObject6 = function _templateObject6() {
return data;
};
return data;
}
function _templateObject5() {
var data = _taggedTemplateLiteral(["\n ", ";\n "]);
_templateObject5 = function _templateObject5() {
return data;
};
return data;
}
function _templateObject4() {
var data = _taggedTemplateLiteral(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n margin-top: 0;\n margin-bottom: ", ";\n &:last-child {\n margin-bottom: 0;\n }\n ", ";\n"]);
_templateObject4 = function _templateObject4() {
return data;
};
return data;
}
function _templateObject3() {
var data = _taggedTemplateLiteral(["\n font-family: ", ";\n"]);
_templateObject3 = function _templateObject3() {
return data;
};
return data;
}
function _templateObject2() {
var data = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: ", ";\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = _taggedTemplateLiteral(["\n color: ", ";\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var secondary = (0, _styledComponents.css)(_templateObject(), (0, _uiToolkit.th)('colorSecondary'));
var small = (0, _styledComponents.css)(_templateObject2(), (0, _uiToolkit.th)('fontSizeBaseSmall'), (0, _uiToolkit.th)("lineHeightBaseSmall"));
var reading = (0, _styledComponents.css)(_templateObject3(), (0, _uiToolkit.th)('fontReading'));
var BaseParagraph = _styledComponents["default"].p(_templateObject4(), (0, _uiToolkit.th)('fontWriting'), (0, _uiToolkit.th)('fontSizeBase'), (0, _uiToolkit.th)("lineHeightBase"), (0, _uiToolkit.th)('space.3'), function (props) {
return props.secondary && secondary;
});
var Paragraph = {
Small: (0, _styledComponents["default"])(BaseParagraph)(_templateObject5(), small),
Reading: (0, _styledComponents["default"])(BaseParagraph)(_templateObject6(), reading),
Writing: BaseParagraph
};
var _default = Paragraph;
exports["default"] = _default;