import "core-js/modules/es6.object.assign";
import "core-js/modules/web.dom.iterable";
import "core-js/modules/es6.array.iterator";
import "core-js/modules/es6.object.keys";

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); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { ICON_TYPES, EuiIcon } from '../icon';
import { EuiText } from '../text';
var colorToClassNameMap = {
  primary: 'euiCallOut--primary',
  success: 'euiCallOut--success',
  warning: 'euiCallOut--warning',
  danger: 'euiCallOut--danger'
};
export var COLORS = Object.keys(colorToClassNameMap);
var sizeToClassNameMap = {
  s: 'euiCallOut--small',
  m: ''
};
export var SIZES = Object.keys(sizeToClassNameMap);
export var EuiCallOut = function EuiCallOut(_ref) {
  var title = _ref.title,
      color = _ref.color,
      size = _ref.size,
      iconType = _ref.iconType,
      children = _ref.children,
      className = _ref.className,
      rest = _objectWithoutProperties(_ref, ["title", "color", "size", "iconType", "children", "className"]);

  var classes = classNames('euiCallOut', colorToClassNameMap[color], sizeToClassNameMap[size], className);
  var headerIcon;

  if (iconType) {
    headerIcon = React.createElement(EuiIcon, {
      className: "euiCallOutHeader__icon",
      type: iconType,
      size: "m",
      "aria-hidden": "true"
    });
  }

  var optionalChildren;

  if (children && size === 's') {
    optionalChildren = React.createElement(EuiText, {
      size: "xs"
    }, children);
  } else if (children) {
    optionalChildren = React.createElement(EuiText, {
      size: "s"
    }, children);
  }

  return React.createElement("div", _extends({
    className: classes
  }, rest), React.createElement("div", {
    className: "euiCallOutHeader"
  }, headerIcon, React.createElement("span", {
    className: "euiCallOutHeader__title"
  }, title)), optionalChildren);
};
EuiCallOut.propTypes = {
  children: PropTypes.node,
  className: PropTypes.string,
  title: PropTypes.node,
  iconType: PropTypes.oneOf(ICON_TYPES),
  color: PropTypes.oneOf(COLORS),
  size: PropTypes.oneOf(SIZES)
};
EuiCallOut.defaultProps = {
  color: 'primary',
  size: 'm'
};
EuiCallOut.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "EuiCallOut",
  "props": {
    "color": {
      "defaultValue": {
        "value": "'primary'",
        "computed": false
      },
      "type": {
        "name": "enum",
        "value": [{
          "value": "\"primary\"",
          "computed": false
        }, {
          "value": "\"success\"",
          "computed": false
        }, {
          "value": "\"warning\"",
          "computed": false
        }, {
          "value": "\"danger\"",
          "computed": false
        }]
      },
      "required": false,
      "description": ""
    },
    "size": {
      "defaultValue": {
        "value": "'m'",
        "computed": false
      },
      "type": {
        "name": "enum",
        "value": [{
          "value": "\"s\"",
          "computed": false
        }, {
          "value": "\"m\"",
          "computed": false
        }]
      },
      "required": false,
      "description": ""
    },
    "children": {
      "type": {
        "name": "node"
      },
      "required": false,
      "description": ""
    },
    "className": {
      "type": {
        "name": "string"
      },
      "required": false,
      "description": ""
    },
    "title": {
      "type": {
        "name": "node"
      },
      "required": false,
      "description": ""
    },
    "iconType": {
      "type": {
        "name": "enum",
        "computed": true,
        "value": "ICON_TYPES"
      },
      "required": false,
      "description": ""
    }
  }
};