@navinc/base-react-components
Version:
Nav's Pattern Library
57 lines (56 loc) • 2.71 kB
JavaScript
;
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const styled_components_1 = __importDefault(require("styled-components"));
const copy_js_1 = __importDefault(require("./copy.js"));
const is_rebrand_js_1 = __importDefault(require("./is-rebrand.js"));
const setColor = (theme, color) => {
if ((0, is_rebrand_js_1.default)(theme))
return color ? theme[color] : theme.navSecondary600;
return color ? theme[color] : theme.flounderYellow200;
};
const StyledAside = styled_components_1.default.aside.withConfig({ displayName: "brc-sc-StyledAside", componentId: "brc-sc-zpi9q" }) `
position: relative;
padding: 0 1em;
margin: 0;
&::before {
content: '';
height: 100%;
position: absolute;
left: 0;
width: 4px;
${({ theme, color = 'flounderYellow200' }) => !(0, is_rebrand_js_1.default)(theme) && `border: solid ${theme[color]} 2px`};
background: ${({ theme, color }) => setColor(theme, color)};
border-radius: 2px;
}
`;
const Title = styled_components_1.default.h3.withConfig({ displayName: "brc-sc-Title", componentId: "brc-sc-1stovik" }) `
color: ${({ theme }) => ((0, is_rebrand_js_1.default)(theme) ? theme.navNeutralDark : theme.neutral500)};
font-size: 12px;
font-weight: bold;
line-height: 18px;
`;
const Text = (0, styled_components_1.default)(copy_js_1.default).attrs(() => ({ size: 'sm' })).withConfig({ displayName: "brc-sc-Text", componentId: "brc-sc-1xflg3h" }) `
color: ${({ theme }) => ((0, is_rebrand_js_1.default)(theme) ? theme.navNeutralDark : theme.neutral500)};
font-style: italic;
`;
const BlockQuote = (_a) => {
var { title, children, color } = _a, props = __rest(_a, ["title", "children", "color"]);
return ((0, jsx_runtime_1.jsxs)(StyledAside, Object.assign({ color: color, "data-testid": "aside" }, props, { children: [title && (0, jsx_runtime_1.jsx)(Title, { children: title }), (0, jsx_runtime_1.jsx)(Text, { children: children })] })));
};
exports.default = BlockQuote;
//# sourceMappingURL=aside.js.map