import _extends from "@babel/runtime/helpers/extends";
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
/**
 * `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 = classNames(baseClassName, {
    [`${baseClassName}--xs-${xs}`]: xs,
    [`${baseClassName}--sm-${sm}`]: sm,
    [`${baseClassName}--md-${md}`]: md,
    [`${baseClassName}--lg-${lg}`]: lg,
    [`${baseClassName}--xl-${xl}`]: xl
  }, className);
  return /*#__PURE__*/React.createElement("div", _extends({
    className: computedClassName
  }, props), children);
};

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

  /**
   * @ignore
   */
  className: PropTypes.string,

  /**
   * @ignore
   */
  baseClassName: PropTypes.string,

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

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

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

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

  /**
   * Column size for `lg` breakpoint (from 1 to 12)
   * @since 0.0.53
   */
  xl: PropTypes.number
};
GridCol.defaultProps = {
  children: null,
  className: null,
  baseClassName: `${CLS_PREFIX}grid__col`,
  xs: null,
  sm: null,
  md: null,
  lg: null,
  xl: null
};
export default GridCol;