import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
import { jsx } from '@emotion/core';
import { BaseHeading } from '../BaseHeading/BaseHeading.esm.js';
import { showCustomCssDeprecationMessage } from '../../utils/maintenance/deprecationMessages.esm.js';

var baseCss = function baseCss(theme) {
  return {
    margin: 0,
    lineHeight: theme.lineHeights.heading // Ask Flo about this

  };
};

var fontVariantCss = {
  DISPLAY: function DISPLAY(theme) {
    return {
      fontFamily: theme.fonts.heading
    };
  },
  UI: function UI(theme) {
    return {
      fontFamily: theme.fonts.headingUI
    };
  }
};

var modifiedCss = function modifiedCss(variant, tone) {
  return function (theme) {
    return [{
      color: theme.tones[tone].text
    }, variant === "PRIMARY" && {
      fontWeight: theme.fontWeights.bold
    }, variant === "EMPHASIZED" && {
      fontWeight: theme.fontWeights.extraBold
    }, variant === "LIGHT" && {
      fontWeight: 100,
      textTransform: "uppercase"
    }];
  };
};

function Heading(_ref) {
  var _ref$tone = _ref.tone,
      tone = _ref$tone === void 0 ? "NEUTRAL" : _ref$tone,
      _ref$variant = _ref.variant,
      variant = _ref$variant === void 0 ? "PRIMARY" : _ref$variant,
      _ref$fontVariant = _ref.fontVariant,
      fontVariant = _ref$fontVariant === void 0 ? "DISPLAY" : _ref$fontVariant,
      _ref$as = _ref.as,
      as = _ref$as === void 0 ? "h2" : _ref$as,
      customCss = _ref.customCss,
      rest = _objectWithoutProperties(_ref, ["tone", "variant", "fontVariant", "as", "customCss"]);

  showCustomCssDeprecationMessage(customCss);
  return jsx(BaseHeading, _extends({
    as: as,
    css: function css(theme) {
      return [baseCss(theme), modifiedCss(variant, tone)(theme), fontVariantCss[fontVariant](theme), customCss];
    }
  }, rest));
}
Heading.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "Heading",
  "props": {
    "tone": {
      "defaultValue": {
        "value": "`NEUTRAL`",
        "computed": false
      },
      "required": false,
      "tsType": {
        "name": "HeadingTone"
      },
      "description": ""
    },
    "variant": {
      "defaultValue": {
        "value": "`PRIMARY`",
        "computed": false
      },
      "required": false,
      "tsType": {
        "name": "HeadingVariant"
      },
      "description": ""
    },
    "fontVariant": {
      "defaultValue": {
        "value": "`DISPLAY`",
        "computed": false
      },
      "required": false,
      "tsType": {
        "name": "HeadingFontVariant"
      },
      "description": ""
    },
    "as": {
      "defaultValue": {
        "value": "`h2`",
        "computed": false
      },
      "required": false
    },
    "customCss": {
      "required": false,
      "tsType": {
        "name": "Interpolation"
      },
      "description": ""
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/Heading/Heading.tsx"] = {
    name: "Heading",
    docgenInfo: Heading.__docgenInfo,
    path: "src/components/Heading/Heading.tsx"
  };
}

export { Heading };
//# sourceMappingURL=Heading.esm.js.map
