` and `` are supported.
* @default 'span'
*/
as?: 'span' | 'p' | 'figcaption';
/**
* Whether to render the text in all caps or not.
* @default false
*/
capitalize?: boolean;
/**
* Where the rendered text should be aligned to.
* @default 'inherit'
*/
align?: 'inherit' | 'left' | 'right' | 'center';
/**
* Accepts a subset of the Zopa brand colors.
* @default `colors.greyDarkest`
*/
color?: string;
}
const Text = styled.span`
margin: 0;
letter-spacing: ${({ theme }) => theme.typography.letterSpacingMap.text};
color: ${({ color, theme }) => color || theme.typography.text.color};
font-size: ${({ theme, size = 'body', capitalize }) => theme.typography.text.sizes[capitalize ? 'small' : size]};
line-height: ${({ theme, size = 'body' }) => theme.typography.lineHeight[size]};
font-weight: ${({ theme, weight = 'regular', capitalize }) => {
return theme.typography.weights[capitalize ? 'bold' : weight];
}};
font-family: ${({ theme }) => theme.typography.primary};
text-align: ${({ align = 'inherit' }) => align};
text-transform: ${({ capitalize }) => capitalize && 'uppercase'};
${({ className = '', as }) =>
(!as || as === 'span') &&
className.split(' ').some((clss) => /[mp](:[mp])?[tblrxy]?-\d+/.test(clss)) &&
`
display: block
`}
`;
const TextWrap = React.forwardRef((props, ref) => {
const theme = useThemeContext();
return ;
});
export default TextWrap;