"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getTabularStyles = exports.getFontWeight = exports.getFontFamily = exports.getFontSize = exports.getTextTransform = exports.underlineRules = exports.getFontStyle = exports.getTextAlign = void 0;

var _styledComponents = require("styled-components");

var tabularStyles = (0, _styledComponents.css)(["font-feature-settings:'tnum';font-kerning:none;"]);

var getTextAlign = function getTextAlign(_ref) {
  var align = _ref.align;
  return align;
};

exports.getTextAlign = getTextAlign;

var getFontStyle = function getFontStyle(_ref2) {
  var italic = _ref2.italic;
  return italic ? 'italic' : undefined;
};

exports.getFontStyle = getFontStyle;

var getTextDecorationLine = function getTextDecorationLine(_ref3) {
  var underlined = _ref3.underlined,
      dottedUnderline = _ref3.dottedUnderline;
  return underlined || dottedUnderline ? 'underline' : undefined;
};

var getTextDecorationStyle = function getTextDecorationStyle(_ref4) {
  var dottedUnderline = _ref4.dottedUnderline;
  return dottedUnderline ? 'dashed' : undefined;
};

var getTextDecorationColor = function getTextDecorationColor(_ref5) {
  var dottedUnderline = _ref5.dottedUnderline,
      theme = _ref5.theme;
  return dottedUnderline ? theme.colorPalette['greyscale-medium'] : undefined;
};

var underlineRules = (0, _styledComponents.css)(["text-decoration-line:", ";text-decoration-style:", ";text-decoration-color:", ";"], getTextDecorationLine, getTextDecorationStyle, getTextDecorationColor);
exports.underlineRules = underlineRules;

var getTextTransform = function getTextTransform(_ref6) {
  var casing = _ref6.casing;
  return casing;
};

exports.getTextTransform = getTextTransform;

var getFontSize = function getFontSize(_ref7) {
  var theme = _ref7.theme,
      _ref7$fontSize = _ref7.fontSize,
      fontSize = _ref7$fontSize === void 0 ? 'f2' : _ref7$fontSize;
  return theme.typescale[fontSize];
};

exports.getFontSize = getFontSize;

var getFontFamily = function getFontFamily(_ref8) {
  var theme = _ref8.theme,
      _ref8$face = _ref8.face,
      face = _ref8$face === void 0 ? 'sans' : _ref8$face;
  return theme.fonts[face];
};

exports.getFontFamily = getFontFamily;

var getFontWeight = function getFontWeight(_ref9) {
  var _ref9$bold = _ref9.bold,
      bold = _ref9$bold === void 0 ? false : _ref9$bold;
  return bold ? '700' : '400';
};

exports.getFontWeight = getFontWeight;

var getTabularStyles = function getTabularStyles(_ref10) {
  var _ref10$tabular = _ref10.tabular,
      tabular = _ref10$tabular === void 0 ? false : _ref10$tabular;
  return tabular ? tabularStyles : '';
};

exports.getTabularStyles = getTabularStyles;