@bootstrap-styled/rsg-components
Version:
Create documentation layouts for your react-styleguidist using Bootstrap-Styled rsg-component. Boostrap Styled rsg-components use the @bootstrap-styled/v4 for recreating the original rsg-components.
105 lines (83 loc) • 4.84 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.propTypes = exports.defaultProps = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _Blockquote = _interopRequireDefault(require("@bootstrap-styled/v4/lib/Blockquote"));
var _borderRadius = require("@bootstrap-styled/css-mixins/lib/border-radius");
var _lodash = _interopRequireDefault(require("lodash.omit"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _lib = _interopRequireDefault(require("map-to-css-modules/lib"));
var _classnames = _interopRequireDefault(require("classnames"));
var _color = _interopRequireDefault(require("@bootstrap-styled/color"));
var defaultProps = {
theme: {
'$enable-rounded': true,
'$brand-parimary': 'blue',
styleguide: {
'$rsg-markdown-block-quote-color': '#333',
'$rsg-markdown-block-quote-font-family': '-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
'$rsg-markdown-block-quote-line-height': '1.5',
'$rsg-markdown-block-quote-border-radius': '5px',
'$rsg-markdown-block-quote-border-width': '1px',
'$rsg-markdown-block-quote-border-left-width': 'px'
}
}
};
/* eslint-disable react/require-default-props */
exports.defaultProps = defaultProps;
var propTypes = {
/**
* @ignore
*/
className: _propTypes.default.string,
// eslint-disable-line react/require-default-props
children: _propTypes.default.node.isRequired,
/** Theme variables. Can be: */
theme: _propTypes.default.shape({
'$enable-rounded': _propTypes.default.bool,
'$brand-primary': _propTypes.default.string,
styleguide: _propTypes.default.shape({
'$rsg-markdown-block-quote-color': _propTypes.default.string,
'$rsg-markdown-block-quote-font-family': _propTypes.default.string,
'$rsg-markdown-block-quote-line-height': _propTypes.default.string,
'$rsg-markdown-block-quote-border-radius': _propTypes.default.string,
'$rsg-markdown-block-quote-border-width': _propTypes.default.string,
'$rsg-markdown-block-quote-border-left-width': _propTypes.default.string
})
}),
/**
* Replace or remove a className from the component.
* See example <a href="https://www.npmjs.com/package/map-to-css-modules" target="_blank">here</a>.
*/
cssModule: _propTypes.default.object // eslint-disable-line react/require-default-props
};
/* eslint-enable react/require-default-props */
exports.propTypes = propTypes;
var BlockquoteUnstyled = function BlockquoteUnstyled(props) {
var _omit = (0, _lodash.default)(props, ['theme']),
className = _omit.className,
children = _omit.children,
cssModule = _omit.cssModule,
attributes = (0, _objectWithoutProperties2.default)(_omit, ["className", "children", "cssModule"]);
return _react.default.createElement(_Blockquote.default, (0, _extends2.default)({
className: (0, _lib.default)((0, _classnames.default)(className, 'rsg-markdown-blockquote'), cssModule)
}, attributes), children);
};
BlockquoteUnstyled.defaultProps = defaultProps;
BlockquoteUnstyled.propTypes = propTypes;
var BlockquoteRsg = (0, _styledComponents.default)(BlockquoteUnstyled).withConfig({
displayName: "BlockquoteRenderer__BlockquoteRsg",
componentId: "sc-1vz6hpn-0"
})([" ", ""], function (props) {
return "\n &.rsg-markdown-blockquote {\n color: ".concat(props.theme.styleguide['$rsg-markdown-block-quote-color'], ";\n font-family: ").concat(props.theme.styleguide['$rsg-markdown-block-quote-font-family'], ";\n line-height: ").concat(props.theme.styleguide['$rsg-markdown-block-quote-line-height'], ";\n border: ").concat(props.theme.styleguide['$rsg-markdown-block-quote-border-width'], " solid ").concat(props.theme['$brand-primary'], ";\n border-left: ").concat(props.theme.styleguide['$rsg-markdown-block-quote-border-left-width'], " solid ").concat(props.theme['$brand-primary'], ";\n ").concat((0, _borderRadius.borderRadius)(props.theme['$enable-rounded'], props.theme.styleguide['$rsg-markdown-block-quote-border-radius']), "\n background-color: ").concat((0, _color.default)(props.theme['$brand-primary']).fade(0.9).toString(), ";\n }\n ");
});
BlockquoteRsg.defaultProps = defaultProps;
BlockquoteRsg.propTypes = propTypes;
var _default = BlockquoteRsg;
exports.default = _default;