"use strict";

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

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

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

var _ButtonIcon = _interopRequireDefault(require("../../ButtonIcon"));

var _index = require("../../../tokens/forimport/index.es");

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

var FILL_COLOR_MAP = {
  aqua: _index.aquaLight,
  yellow: _index.yellowLight,
  blue: _index.blueLight,
  green: _index.greenLight,
  orange: _index.orangeLight,
  pink: _index.pinkLight,
  red: _index.redLight,
  magenta: _index.magentaLight,
  purple: _index.purpleLight
};
/**
 * @param {Object} props - Properties passed to component
 * @returns {ReactElement}
 * @private
 */

var DismissButton = function DismissButton(props) {
  return _react["default"].createElement("div", {
    className: "oui-pill--dismiss push-half--left flex",
    style: {
      height: "12px",
      width: "12px",
      borderRadius: "50%",
      backgroundColor: FILL_COLOR_MAP[props.backgroundColor],
      color: props.fill
    }
  }, _react["default"].createElement(_ButtonIcon["default"], {
    iconName: "close",
    iconFill: props.fill,
    size: "small",
    onClick: props.onClick,
    style: "unstyled",
    testSection: props.testSection && "".concat(props.testSection, "-dismiss")
  }));
};

DismissButton.propTypes = {
  /** Background color of the token */
  backgroundColor: _propTypes["default"].string,

  /** Color of the dismiss X */
  fill: _propTypes["default"].string,

  /** Function to call that dismisses the token */
  onClick: _propTypes["default"].func.isRequired,

  /** Hook for automated JavaScript tests */
  testSection: _propTypes["default"].string
};
DismissButton.defaultProps = {
  fill: "white"
};
DismissButton.displayName = "DismissButton";
var _default = DismissButton;
exports["default"] = _default;