"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _ref = require("rc-util/lib/ref");

var _warning = _interopRequireDefault(require("../../../lib/_util/warning"));

var _ConfigContext = _interopRequireDefault(require("../../../lib/config-provider/ConfigContext"));

var _excluded = ["prefixCls", "component", "className", "aria-label", "setContentRef", "children"];

var Typography = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
  var customizePrefixCls = props.prefixCls,
      component = props.component,
      className = props.className,
      ariaLabel = props['aria-label'],
      setContentRef = props.setContentRef,
      children = props.children,
      restProps = (0, _objectWithoutProperties2["default"])(props, _excluded);

  var _React$useContext = _react["default"].useContext(_ConfigContext["default"]),
      getProPrefixCls = _React$useContext.getProPrefixCls;

  var mergedRef = ref;

  if (setContentRef) {
    (0, _warning["default"])(false, "[c7n: Typography] setContentRef is deprecated. Please use ref instead.");
    mergedRef = (0, _ref.composeRef)(ref, setContentRef);
  }

  var Component = component;
  var prefixCls = getProPrefixCls('typography', customizePrefixCls);
  var componentClassName = (0, _classnames["default"])(prefixCls, className);
  return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({
    className: componentClassName,
    "aria-label": ariaLabel,
    ref: mergedRef
  }, restProps), children);
});

Typography.__PRO_TYPOGRAPHY = true;
Typography.displayName = 'Typography';
Typography.defaultProps = {
  component: 'article'
};
var _default = Typography;
exports["default"] = _default;
//# sourceMappingURL=Typography.js.map
