@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
28 lines • 1.13 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
const _excluded = ["element", "className", "size", "lineHeight", "align", "family", "weight", "decoration", "slant"];
import React from 'react';
import classnames from 'classnames';
import E from '../Element';
const Typography = _ref => {
let {
element = 'p',
className,
size,
lineHeight,
align,
family,
weight,
decoration,
slant
} = _ref,
props = _objectWithoutProperties(_ref, _excluded);
return React.createElement(E, _extends({
as: element
}, props, {
className: classnames(className, (lineHeight || size) && `dnb-t__line-height--${lineHeight || size}`, size && `dnb-t__size--${size}`, align && `dnb-t__align--${align}`, family && `dnb-t__family--${family}`, weight && `dnb-t__weight--${weight}`, decoration && `dnb-t__decoration--${decoration}`, slant && `dnb-t__slant--${slant}`)
}));
};
Typography._supportsSpacingProps = true;
export default Typography;
//# sourceMappingURL=Typography.js.map