UNPKG

styled-jumbotron-component

Version:

The bootstrap jumbotron component created with styled-components

134 lines (100 loc) 4.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Jumbotron = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); var _styledBaseComponents = require("styled-base-components"); var _styledConfig = require("styled-config"); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _templateObject7() { var data = _taggedTemplateLiteral(["\n margin-bottom: 2rem;\n background-color: ", ";\n @media(min-width: ", ") {\n padding: ", ";\n };\n @media(max-width: ", ") {\n padding: ", ";\n };\n ", ";\n ", ";\n"]); _templateObject7 = function _templateObject7() { return data; }; return data; } function _templateObject6() { var data = _taggedTemplateLiteral(["\n border-radius: ", "\n "]); _templateObject6 = function _templateObject6() { return data; }; return data; } function _templateObject5() { var data = _taggedTemplateLiteral(["\n border-radius: ", "\n "]); _templateObject5 = function _templateObject5() { return data; }; return data; } function _templateObject4() { var data = _taggedTemplateLiteral(["\n border-radius: ", "\n "]); _templateObject4 = function _templateObject4() { return data; }; return data; } function _templateObject3() { var data = _taggedTemplateLiteral(["\n padding: ", ";\n "]); _templateObject3 = function _templateObject3() { return data; }; return data; } function _templateObject2() { var data = _taggedTemplateLiteral(["\n padding: ", ";\n "]); _templateObject2 = function _templateObject2() { return data; }; return data; } function _templateObject() { var data = _taggedTemplateLiteral(["\n padding-right: ", ";\n padding-left: ", ";\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 padding = function padding(props) { if (props.fluid) { return (0, _styledComponents.css)(_templateObject(), (0, _styledConfig.getPadding)(props, 'jumbotron', 'fluidRight'), (0, _styledConfig.getPadding)(props, 'jumbotron', 'fluidLeft')); } else if (props.pill) { return (0, _styledComponents.css)(_templateObject2(), (0, _styledConfig.getPadding)(props, 'jumbotron', 'pill')); } return (0, _styledComponents.css)(_templateObject3(), (0, _styledConfig.getPadding)(props, 'jumbotron', 'default')); }; var borderRadius = function borderRadius(props) { if (props.fluid || props.noRadius) { return (0, _styledComponents.css)(_templateObject4(), (0, _styledConfig.getBorderRadius)(props, 'jumbotron', 'noRadius')); } else if (props.pill) { return (0, _styledComponents.css)(_templateObject5(), (0, _styledConfig.getBorderRadius)(props, 'jumbotron', 'pill')); } return (0, _styledComponents.css)(_templateObject6(), (0, _styledConfig.getBorderRadius)(props, 'jumbotron', 'lg')); }; var Jumbotron = (0, _styledComponents.default)(_styledBaseComponents.Div)(_templateObject7(), function (props) { return (0, _styledConfig.getColor)(props, 'jumbotron', 'backgroundColor'); }, function (props) { return (0, _styledConfig.getConcreteBreakpointSize)(props.theme, 'sm'); }, function (props) { if (props.pill) { return (0, _styledConfig.getPadding)(props, 'jumbotron', 'lgPill'); } return (0, _styledConfig.getPadding)(props, 'jumbotron', 'sm'); }, function (props) { return (0, _styledConfig.getConcreteBreakpointSize)(props, 'md'); }, function (props) { if (props.pill) { return (0, _styledConfig.getPadding)(props, 'jumbotron', 'smPill'); } return (0, _styledConfig.getPadding)(props, 'jumbotron', 'sm'); }, function (props) { return padding(props); }, function (props) { return borderRadius(props); }); exports.Jumbotron = Jumbotron; Jumbotron.defaultProps = { theme: _styledConfig.theme };