"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _index = require("../../../../index");
var _FlexTableProvider = require("../FlexTableProvider");
var _getStylesForSizes = _interopRequireDefault(require("../getStylesForSizes"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var getFontSizeStyles = function getFontSizeStyles(_ref) {
  var fontSize = _ref.fontSize,
    theme = _ref.theme;
  if (fontSize === 's') {
    return "\n      font-size: 12px;\n      line-height: ".concat(theme.spacing.unit(4), "px;\n    ");
  }
  return "\n    font-size: 14px;\n    line-height: ".concat(theme.spacing.unit(5), "px;\n  ");
};
var StyledTypography = (0, _styledComponents.default)(_index.Typography).withConfig({
  displayName: "Text__StyledTypography",
  componentId: "sc-1thuey1-0"
})(["", ""], (0, _getStylesForSizes.default)(function (p) {
  return {
    xs: p.$xs,
    sm: p.$sm,
    md: p.$md,
    lg: p.$lg,
    xl: p.$xl
  };
}, {
  fontSize: getFontSizeStyles
}));
var Text = function Text(_ref2) {
  var className = _ref2.className,
    color = _ref2.color,
    weight = _ref2.weight,
    children = _ref2.children;
  var _useFlexTable = (0, _FlexTableProvider.useFlexTable)('fontSize'),
    xs = _useFlexTable.xs,
    sm = _useFlexTable.sm,
    md = _useFlexTable.md,
    lg = _useFlexTable.lg,
    xl = _useFlexTable.xl;
  return _react.default.createElement(StyledTypography, {
    className: className,
    color: color,
    weight: weight,
    $xs: xs,
    $sm: sm,
    $md: md,
    $lg: lg,
    $xl: xl
  }, children);
};
var _default = exports.default = Text;