@zenkit/typography
Version:
ZenKit components for impliments typography
31 lines (28 loc) • 813 B
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import * as React from 'react';
import cn from 'classnames';
import { withStyles } from '@zenkit/styles';
import Text from './text';
export const styles = {
root: {
margin: 0,
padding: 0,
whiteSpace: 'pre-wrap',
overflowX: 'auto'
}
};
function Pre(props) {
const {
classes,
className: classNameProps,
children
} = props,
otherProps = _objectWithoutPropertiesLoose(props, ["classes", "className", "children"]);
return React.createElement(Text, _extends({
is: "pre",
family: "monospace",
className: cn(classes.root, classNameProps)
}, otherProps), children);
}
export default withStyles(styles)(Pre);