import _getOr from "lodash/fp/getOr";
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Provider, { GetSkinFromContext } from '../../../atom/provider';
import Range from '../../../atom/range';
import style from './style.css';
const QuestionRange = (props, legacyContext) => {
  const {
    title,
    minLabel,
    maxLabel,
    groupAriaLabel,
    ...rangeProps
  } = props;
  const skin = GetSkinFromContext(legacyContext);
  const defaultColor = _getOr('#00B0FF', 'common.primary', skin);
  const titleStyle = {
    color: defaultColor
  };
  return /*#__PURE__*/React.createElement("div", {
    className: style.wrapper,
    role: "group",
    "aria-label": groupAriaLabel,
    title: groupAriaLabel
  }, /*#__PURE__*/React.createElement("span", {
    style: titleStyle,
    className: classnames(style.title, style.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: title
    }
  }), /*#__PURE__*/React.createElement(Range, rangeProps), /*#__PURE__*/React.createElement("div", {
    className: style.labelWrapper
  }, /*#__PURE__*/React.createElement("span", {
    className: classnames(style.label, style.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: minLabel
    }
  }), /*#__PURE__*/React.createElement("span", {
    className: classnames(style.label, style.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: maxLabel
    }
  })));
};
QuestionRange.contextTypes = {
  skin: Provider.childContextTypes.skin
};
QuestionRange.propTypes = process.env.NODE_ENV !== "production" ? {
  ...Range.propTypes,
  title: PropTypes.string,
  minLabel: PropTypes.string,
  maxLabel: PropTypes.string,
  groupAriaLabel: PropTypes.string
} : {};
export default QuestionRange;
//# sourceMappingURL=index.js.map