"use strict";

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

var _kind = _interopRequireDefault(require("@enact/core/kind"));

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

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

var _FormCheckbox = _interopRequireDefault(require("../FormCheckbox"));

var _ToggleItem = _interopRequireDefault(require("../ToggleItem"));

var _FormCheckboxItem = _interopRequireDefault(require("./FormCheckboxItem.less"));

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

/**
 * Renders a form item with a checkbox component. Useful to show a selected state on an item inside a form.
 *
 * @class FormCheckboxItem
 * @memberof moonstone/FormCheckboxItem
 * @extends moonstone/ToggleItem.ToggleItem
 * @ui
 * @public
 */
var FormCheckboxItemBase = (0, _kind.default)({
  name: 'FormCheckboxItem',
  propTypes:
  /** @lends moonstone/FormCheckboxItem.FormCheckboxItem.prototype */
  {
    /**
     * Customizes the component by mapping the supplied collection of CSS class names to the
     * corresponding internal Elements and states of this component.
     *
     * The following classes are supported:
     *
     * * `formCheckboxItem` - The root class name
     *
     * @type {Object}
     * @public
     */
    css: _propTypes.default.object
  },
  styles: {
    css: _FormCheckboxItem.default,
    className: 'formCheckboxItem',
    publicClassNames: ['formCheckboxItem']
  },
  render: function render(props) {
    return _react.default.createElement(_ToggleItem.default, _extends({
      "data-webos-voice-intent": "SelectCheckItem"
    }, props, {
      css: props.css,
      iconComponent: _FormCheckbox.default
    }));
  }
});
exports.FormCheckboxItemBase = exports.FormCheckboxItem = FormCheckboxItemBase;
var _default = FormCheckboxItemBase;
exports.default = _default;