"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

var _Icon = require("../Icon");

var _PseudoBox = require("../PseudoBox");

var _styles = _interopRequireDefault(require("./styles"));

var __jsx = _react["default"].createElement;

var CloseButton = function CloseButton(_ref) {
  var _ref$size = _ref.size,
      size = _ref$size === void 0 ? 'sm' : _ref$size,
      _ref$type = _ref.type,
      type = _ref$type === void 0 ? 'button' : _ref$type,
      isDisabled = _ref.isDisabled,
      _ref$color = _ref.color,
      color = _ref$color === void 0 ? 'faintText' : _ref$color,
      _ref$ariaLabel = _ref['aria-label'],
      ariaLabel = _ref$ariaLabel === void 0 ? 'Close' : _ref$ariaLabel,
      rest = (0, _objectWithoutProperties2["default"])(_ref, ["size", "type", "isDisabled", "color", "aria-label"]);
  var closeButtonStyleProps = (0, _styles["default"])({
    size: size
  });
  var iconSizes = {
    lg: '16px',
    md: '12px',
    sm: '10px'
  };
  var iconSize = iconSizes[size];
  return __jsx(_PseudoBox.PseudoBox, (0, _extends2["default"])({
    as: "button",
    "aria-disabled": isDisabled,
    disabled: isDisabled,
    "aria-label": ariaLabel,
    type: type
  }, closeButtonStyleProps, rest), __jsx(_Icon.Icon, {
    color: color,
    focusable: false,
    name: "close",
    "aria-hidden": true,
    size: iconSize
  }));
};

exports.CloseButton = CloseButton;
//# sourceMappingURL=CloseButton.js.map