"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _classnames = _interopRequireDefault(require("classnames"));

var _constants = require("../../constants");

// Copyright 1999-2020. Plesk International GmbH. All rights reserved.

/**
 * `GridCol` component is a part of [Grid](#!/Grid) component.
 * @since 0.0.48
 */
const GridCol = ({
  baseClassName,
  className,
  children,
  xs,
  sm,
  md,
  lg,
  xl,
  ...props
}) => {
  const computedClassName = (0, _classnames.default)(baseClassName, {
    ["".concat(baseClassName, "--xs-").concat(xs)]: xs,
    ["".concat(baseClassName, "--sm-").concat(sm)]: sm,
    ["".concat(baseClassName, "--md-").concat(md)]: md,
    ["".concat(baseClassName, "--lg-").concat(lg)]: lg,
    ["".concat(baseClassName, "--xl-").concat(xl)]: xl
  }, className);
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
    className: computedClassName
  }, props), children);
};

GridCol.propTypes = {
  /**
   * Content of the `GridCol`.
   * @since 0.0.48
   */
  children: _propTypes.default.node,

  /**
   * @ignore
   */
  className: _propTypes.default.string,

  /**
   * @ignore
   */
  baseClassName: _propTypes.default.string,

  /**
   * Column size for `xs` breakpoint (from 1 to 12)
   * @since 0.0.53
   */
  xs: _propTypes.default.number,

  /**
   * Column size for `sm` breakpoint (from 1 to 12)
   * @since 0.0.53
   */
  sm: _propTypes.default.number,

  /**
   * Column size for `sm` breakpoint (from 1 to 12)
   * @since 0.0.53
   */
  md: _propTypes.default.number,

  /**
   * Column size for `md` breakpoint (from 1 to 12)
   * @since 0.0.53
   */
  lg: _propTypes.default.number,

  /**
   * Column size for `lg` breakpoint (from 1 to 12)
   * @since 0.0.53
   */
  xl: _propTypes.default.number
};
GridCol.defaultProps = {
  children: null,
  className: null,
  baseClassName: "".concat(_constants.CLS_PREFIX, "grid__col"),
  xs: null,
  sm: null,
  md: null,
  lg: null,
  xl: null
};
var _default = GridCol;
exports.default = _default;