@navinc/base-react-components
Version:
Nav's Pattern Library
57 lines • 2.15 kB
JavaScript
import styled from 'styled-components';
const variants = {
xl: {
fontFamily: 'Manrope, sans-serif',
fontSize: '56px',
lineHeight: '1.143em', // approx 64px
htmlElement: 'h1',
},
lg: {
fontFamily: 'Manrope, sans-serif',
fontSize: '48px',
lineHeight: '1.167em', // approx 56px
htmlElement: 'h2',
},
md: {
fontFamily: 'Manrope, sans-serif',
fontSize: '32px',
lineHeight: '1.125em', // approx 36px
htmlElement: 'h3',
},
sm: {
fontFamily: 'Manrope, sans-serif',
fontSize: '24px',
lineHeight: '1.333em', // approx 32px
htmlElement: 'h4',
},
xs: {
fontFamily: 'Manrope, sans-serif',
fontSize: '20px',
lineHeight: '1.4em', // approx 28px
htmlElement: 'h5',
},
};
/**
* @deprecated Use `CopyVariant as Copy` instead. Use `component='h#'` to turn any Copy component into a Header tag. This component will be removed in a future release. CopyVariant replaces Header, Copy, and Text.
*/
export const Header = styled.h1.attrs(({ size }) => {
var _a;
if (!size) {
size = 'xs';
}
return {
as: (_a = variants[size]) === null || _a === void 0 ? void 0 : _a.htmlElement,
size,
};
}).withConfig({ displayName: "brc-sc-Header", componentId: "brc-sc-1wvlsd3" }) `
font-family: ${({ size }) => { var _a, _b; return (_b = (_a = variants[size]) === null || _a === void 0 ? void 0 : _a.fontFamily) !== null && _b !== void 0 ? _b : variants.md.fontFamily; }};
margin-top: 0;
margin-bottom: 0;
padding: 0;
color: ${({ theme }) => theme.navNeutralDark};
font-size: ${({ size }) => { var _a, _b; return (_b = (_a = variants[size]) === null || _a === void 0 ? void 0 : _a.fontSize) !== null && _b !== void 0 ? _b : variants.md.fontSize; }};
line-height: ${({ size }) => { var _a, _b; return (_b = (_a = variants[size]) === null || _a === void 0 ? void 0 : _a.lineHeight) !== null && _b !== void 0 ? _b : variants.md.lineHeight; }};
font-weight: bold;
`;
Header.displayName = 'Header';
//# sourceMappingURL=header.js.map