UNPKG

@heycar-uikit/core

Version:
15 lines (11 loc) 1.75 kB
import React from 'react'; import cn from 'classnames'; import { defaultVariantMapping } from './Typography.constants.js'; var styles = {"typography":"typography__typography_1kfjd","display1":"typography__display1_1kfjd","display2":"typography__display2_1kfjd","h1":"typography__h1_1kfjd","h2":"typography__h2_1kfjd","h3":"typography__h3_1kfjd","h4":"typography__h4_1kfjd","h5":"typography__h5_1kfjd","h6":"typography__h6_1kfjd","subheading1":"typography__subheading1_1kfjd","subheading2":"typography__subheading2_1kfjd","subheading3":"typography__subheading3_1kfjd","subheading4":"typography__subheading4_1kfjd","body1":"typography__body1_1kfjd","body2":"typography__body2_1kfjd","body3":"typography__body3_1kfjd","body4":"typography__body4_1kfjd","caption1":"typography__caption1_1kfjd","caption2":"typography__caption2_1kfjd","caption3":"typography__caption3_1kfjd","caption4":"typography__caption4_1kfjd","caption5":"typography__caption5_1kfjd","overline1":"typography__overline1_1kfjd","overline2":"typography__overline2_1kfjd","button1":"typography__button1_1kfjd","button2":"typography__button2_1kfjd","button3":"typography__button3_1kfjd","buttonLink1":"typography__buttonLink1_1kfjd","buttonLink2":"typography__buttonLink2_1kfjd","buttonLink3":"typography__buttonLink3_1kfjd"}; require('./styles/variant.css'); const Typography = ({ variant = 'body3', className, Component = defaultVariantMapping[variant], children, dataTestId, ...restProps }) => { const classNames = cn(styles.typography, styles[variant], className); return (React.createElement(Component, { className: classNames, "data-test-id": dataTestId, ...restProps }, children)); }; Typography.displayName = 'Typography'; export { Typography, Typography as default };