@navinc/base-react-components
Version:
Nav's Pattern Library
45 lines (44 loc) • 1.85 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;
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import styled from 'styled-components';
import { Copy } from './copy.js';
const setColor = (theme, color) => (color ? theme[color] : theme.navSecondary600);
const StyledAside = styled.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;
background: ${({ theme, color }) => setColor(theme, color)};
border-radius: 2px;
}
`;
const Title = styled.h3.withConfig({ displayName: "brc-sc-Title", componentId: "brc-sc-1stovik" }) `
color: ${({ theme }) => theme.navNeutralDark};
font-size: 12px;
font-weight: bold;
line-height: 18px;
`;
const Text = styled(Copy).attrs(() => ({ size: 'sm' })).withConfig({ displayName: "brc-sc-Text", componentId: "brc-sc-1xflg3h" }) `
color: ${({ theme }) => theme.navNeutralDark};
font-style: italic;
`;
export const Aside = (_a) => {
var { title, children, color } = _a, props = __rest(_a, ["title", "children", "color"]);
return (_jsxs(StyledAside, Object.assign({ color: color, "data-testid": "aside" }, props, { children: [title && _jsx(Title, { children: title }), _jsx(Text, { children: children })] })));
};
//# sourceMappingURL=aside.js.map