"use strict";

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

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

var _BodyText = _interopRequireDefault(require("@enact/ui/BodyText"));

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

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

var _compose = _interopRequireDefault(require("ramda/src/compose"));

var _Pure = _interopRequireDefault(require("@enact/ui/internal/Pure"));

var _Skinnable = _interopRequireDefault(require("../Skinnable"));

var _BodyText2 = _interopRequireDefault(require("./BodyText.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); }

function _objectWithoutProperties(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]; } 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; }

/**
 * A simple text block component.
 *
 * This component is most often not used directly but may be composed within another component as it
 * is within [BodyText]{@link moonstone/BodyText.BodyText}.
 *
 * @class BodyTextBase
 * @memberof moonstone/BodyText
 * @extends ui/BodyText.BodyText
 * @ui
 * @public
 */
var BodyTextBase = (0, _kind.default)({
  name: 'BodyText',
  propTypes:
  /** @lends moonstone/BodyText.BodyTextBase.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:
     *
     * * `bodyText` - The root class name
     *
     * @type {Object}
     * @public
     */
    css: _propTypes.default.object
  },
  styles: {
    css: _BodyText2.default,
    publicClassNames: 'bodyText'
  },
  render: function render(_ref) {
    var css = _ref.css,
        rest = _objectWithoutProperties(_ref, ["css"]);

    return _react.default.createElement(_BodyText.default, _extends({}, rest, {
      css: css
    }));
  }
});
/**
 * Applies Moonstone specific behaviors to [BodyText]{@link moonstone/BodyText.BodyTextBase}.
 *
 * @hoc
 * @memberof moonstone/BodyText
 * @mixes moonstone/Skinnable.Skinnable
 * @public
 */

exports.BodyTextBase = BodyTextBase;
var BodyTextDecorator = (0, _compose.default)(_Pure.default, _Skinnable.default);
/**
 * A simple text block component, ready to use in Moonstone applications.
 *
 * `BodyText` may be used to display a block of text and is sized and spaced appropriately for a
 * Moonstone application.
 *
 * Usage:
 * ```
 * <BodyText>
 *  I have a Ham radio. There are many like it, but this one is mine.
 * </BodyText>
 * ```
 *
 * @class BodyText
 * @memberof moonstone/BodyText
 * @extends moonstone/BodyText.BodyTextBase
 * @mixes moonstone/BodyText.BodyTextDecorator
 * @ui
 * @public
 */

exports.BodyTextDecorator = BodyTextDecorator;
var BodyText = BodyTextDecorator(BodyTextBase);
exports.BodyText = BodyText;
var _default = BodyText;
exports.default = _default;