| 1 |
import styled from 'styled-components'; |
| 2 |
import { getStyle } from 'e-utils'; |
| 3 |
import styles from 'e-styles/text'; |
| 4 |
|
| 5 |
const SharedText = styled.p.attrs( ( props ) => ( { as: props.tag } ) )`${ ( props ) => getStyle( styles, props, 'shared' ) }`; |
| 6 |
|
| 7 |
const Text = styled( SharedText )`${ ( props ) => getStyle( styles, props, 'unique' ) }`; |
| 8 |
|
| 9 |
Text.propTypes = { |
| 10 |
className: PropTypes.string, |
| 11 |
children: PropTypes.any, |
| 12 |
variant: PropTypes.oneOf( [ 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' ] ), |
| 13 |
tag: PropTypes.string, |
| 14 |
}; |
| 15 |
|
| 16 |
Text.defaultProps = { |
| 17 |
className: '', |
| 18 |
tag: 'p', |
| 19 |
}; |
| 20 |
|
| 21 |
export default Text; |
| 22 |
|