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, { forwardRef } from "react";
import classNames from "classnames";
export var GridContainer = forwardRef(function (_ref, ref) {
  var children = _ref.children,
      className = _ref.className,
      layout = _ref.layout,
      _ref$tag = _ref.tag,
      Tag = _ref$tag === void 0 ? "div" : _ref$tag,
      props = _objectWithoutProperties(_ref, ["children", "className", "layout", "tag"]);

  var layoutClass = layout ? "-layout" : "";
  return React.createElement(Tag, _extends({
    className: classNames("axiom".concat(layoutClass, "-grid-container"), className),
    ref: ref
  }, props), children);
});
GridContainer.displayName = "GridContainer";
export var Grid = forwardRef(function (_ref2, ref) {
  var children = _ref2.children,
      className = _ref2.className,
      layout = _ref2.layout,
      _ref2$tag = _ref2.tag,
      Tag = _ref2$tag === void 0 ? "div" : _ref2$tag,
      props = _objectWithoutProperties(_ref2, ["children", "className", "layout", "tag"]);

  var layoutClass = layout ? "-layout" : "";
  return React.createElement(Tag, _extends({
    className: classNames("axiom".concat(layoutClass, "-grid"), className),
    ref: ref
  }, props), children);
});
Grid.displayName = "Grid";
export var GridCell = forwardRef(function (_ref3, ref) {
  var className = _ref3.className,
      children = _ref3.children,
      large = _ref3.large,
      layout = _ref3.layout,
      medium = _ref3.medium,
      small = _ref3.small,
      _ref3$tag = _ref3.tag,
      Tag = _ref3$tag === void 0 ? "div" : _ref3$tag,
      props = _objectWithoutProperties(_ref3, ["className", "children", "large", "layout", "medium", "small", "tag"]);

  var spanClasses = [];
  var layoutClass = layout ? "-layout" : "";

  if (small) {
    spanClasses.push("axiom".concat(layoutClass, "-grid__cell--span-").concat(small, "-small"));
  }

  if (medium) {
    spanClasses.push("axiom".concat(layoutClass, "-grid__cell--span-").concat(medium, "-medium"));
  }

  if (large) {
    spanClasses.push("axiom".concat(layoutClass, "-grid__cell--span-").concat(large, "-large"));
  }

  return React.createElement(Tag, _extends({
    className: classNames("axiom".concat(layoutClass, "-grid__cell"), spanClasses, className),
    ref: ref
  }, props), children);
});
GridCell.displayName = "GridCell";