import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "children", "description", "icon"];
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { InfoSolid16 } from '@wfp/icons-react';
import classNames from 'classnames';
import { settings } from '../../globals/js';
import Tooltip from '../Tooltip/Tooltip';
var prefix = settings.prefix;
/** FormHint allows you to add a longer explanation to an input element. */

var FormHint = function FormHint(_ref) {
  var className = _ref.className,
      children = _ref.children,
      description = _ref.description,
      icon = _ref.icon,
      other = _objectWithoutProperties(_ref, _excluded);

  var formHintClasses = classNames("".concat(prefix, "--form-hint"), className);
  return /*#__PURE__*/React.createElement(Tooltip, {
    content: children
  }, /*#__PURE__*/React.createElement("div", {
    className: formHintClasses
  }, /*#__PURE__*/React.createElement(InfoSolid16, {
    width: "15",
    height: "15",
    description: children
  })));
};

FormHint.propTypes = {
  /**
   * Specify an optional className to be applied to the wrapper node
   */
  className: PropTypes.string,

  /**
   * The tooltips content can be a string or an component
   */
  children: PropTypes.node,

  /**
   * Specify a custom icon for the hint
   */
  icon: PropTypes.object
};
FormHint.defaultProps = {
  icon: InfoSolid16
};
export default FormHint;