import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["prefixCls", "className"];
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import CheckBoxIcon from '../icons/internals/CheckBox';
import CheckBoxOutlineBlankIcon from '../icons/internals/CheckBoxOutlineBlank';
import IndeterminateCheckBox from '../icons/internals/IndeterminateCheckBox';
import SwitchBase from '../switchBase';
var propTypes = {
  prefixCls: PropTypes.string,

  /** 标签文本 */
  label: PropTypes.node,

  /** 是否禁用 */
  disabled: PropTypes.bool,

  /** 选中状态（适用于受控组件） */
  checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),

  /** 选中状态默认值 */
  defaultChecked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),

  /** 选中状态icon */
  checkedIcon: PropTypes.node,
  className: PropTypes.string,

  /** 未选中状态icon */
  uncheckedIcon: PropTypes.node,

  /** 是否不定状态 */
  indeterminate: PropTypes.bool,

  /** 不定状态icon */
  indeterminateIcon: PropTypes.node,

  /** 获取input的ref */
  inputRef: PropTypes.func,

  /** 选中状态改变时的回调 function(e, checked) */
  onChange: PropTypes.func
};
var defaultProps = {
  defaultChecked: false,
  prefixCls: 'ne-checkbox',
  disabled: false,
  indeterminate: false,
  indeterminateIcon: /*#__PURE__*/React.createElement(IndeterminateCheckBox, null),
  checkedIcon: /*#__PURE__*/React.createElement(CheckBoxIcon, null),
  uncheckedIcon: /*#__PURE__*/React.createElement(CheckBoxOutlineBlankIcon, null)
};
/**
 * Checkbox
 */

export default function Checkbox(props) {
  var prefixCls = props.prefixCls,
      className = props.className,
      other = _objectWithoutProperties(props, _excluded);

  return /*#__PURE__*/React.createElement(SwitchBase, _extends({
    className: classNames(prefixCls, className),
    type: "checkbox"
  }, other));
}
Checkbox.propTypes = propTypes;
Checkbox.defaultProps = defaultProps;