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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

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';
export var GROW_SIZES = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
export var EuiFlexItem = function EuiFlexItem(_ref) {
  var children = _ref.children,
      className = _ref.className,
      grow = _ref.grow,
      Component = _ref.component,
      rest = _objectWithoutProperties(_ref, ["children", "className", "grow", "component"]);

  var classes = classNames('euiFlexItem', _defineProperty({
    'euiFlexItem--flexGrowZero': !grow
  }, "euiFlexItem--flexGrow".concat(grow), GROW_SIZES.indexOf(grow) >= 0), className);
  return React.createElement(Component, _extends({
    className: classes
  }, rest), children);
};
EuiFlexItem.propTypes = {
  children: PropTypes.node,
  grow: growPropType,
  component: PropTypes.oneOf(['div', 'span', 'figure'])
};

function growPropType(props, propName, componentName) {
  var value = props[propName];
  var validValues = [null, undefined, true, false].concat(GROW_SIZES);

  if (validValues.indexOf(value) === -1) {
    return new Error("Prop `".concat(propName, "` supplied to `").concat(componentName, "` must be a boolean or an integer between 1 and 10."));
  }
}

EuiFlexItem.defaultProps = {
  grow: true,
  component: 'div'
};
EuiFlexItem.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "EuiFlexItem",
  "props": {
    "grow": {
      "defaultValue": {
        "value": "true",
        "computed": false
      },
      "type": {
        "name": "custom",
        "raw": "growPropType"
      },
      "required": false,
      "description": ""
    },
    "component": {
      "defaultValue": {
        "value": "'div'",
        "computed": false
      },
      "type": {
        "name": "enum",
        "value": [{
          "value": "'div'",
          "computed": false
        }, {
          "value": "'span'",
          "computed": false
        }, {
          "value": "'figure'",
          "computed": false
        }]
      },
      "required": false,
      "description": ""
    },
    "children": {
      "type": {
        "name": "node"
      },
      "required": false,
      "description": ""
    }
  }
};