"use strict";

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

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

var _Input = _interopRequireDefault(require("./Input"));

var _Label = _interopRequireDefault(require("./Label"));

require("./Form.css");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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; }

var _default = function _default(_ref) {
  var id = _ref.id,
      className = _ref.className,
      _ref$type = _ref.type,
      type = _ref$type === void 0 ? 'radio' : _ref$type,
      name = _ref.name,
      value = _ref.value,
      label = _ref.label,
      checked = _ref.checked,
      style = _ref.style,
      onClick = _ref.onClick,
      restProps = _objectWithoutProperties(_ref, ["id", "className", "type", "name", "value", "label", "checked", "style", "onClick"]);

  return _react.default.createElement("div", {
    className: "vs-choice-input ".concat(className ? className : ''),
    style: style
  }, _react.default.createElement(_Label.default, _extends({}, restProps, {
    htmlFor: id,
    fontWeight: "normal"
  }), _react.default.createElement(_Input.default, _extends({}, restProps, {
    id: id,
    type: type,
    name: name,
    value: value,
    checked: checked,
    onClick: onClick
  })), label));
};

exports.default = _default;