antd
Version:
An enterprise-class UI design language and React components implementation
44 lines (36 loc) • 1.81 kB
JavaScript
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var __rest = this && this.__rest || function (s, e) {
var t = {};
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
}
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
import * as React from 'react';
import classNames from 'classnames';
import { ConfigConsumer } from '../config-provider';
var Typography = function Typography(_a) {
var customizePrefixCls = _a.prefixCls,
_a$component = _a.component,
component = _a$component === void 0 ? 'article' : _a$component,
className = _a.className,
ariaLabel = _a['aria-label'],
setContentRef = _a.setContentRef,
children = _a.children,
restProps = __rest(_a, ["prefixCls", "component", "className", 'aria-label', "setContentRef", "children"]);
return React.createElement(ConfigConsumer, null, function (_ref) {
var getPrefixCls = _ref.getPrefixCls;
var Component = component;
var prefixCls = getPrefixCls('typography', customizePrefixCls);
return React.createElement(Component, _extends({
className: classNames(prefixCls, className),
"aria-label": ariaLabel,
ref: setContentRef
}, restProps), children);
});
};
export default Typography;
//# sourceMappingURL=Typography.js.map