"use strict";

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

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

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _behaviors = require("../../../behaviors");

var _index = require("../../../icon/ellipsis/index");

var _branding = require("../../../../mixins/branding");

var _focus = require("../../../../mixins/focus");

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 = _objectWithoutPropertiesLoose(source, excluded); var key, i; 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; }

function _objectWithoutPropertiesLoose(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]; } return target; }

var EllipsisButtonWrapper = (0, _styledComponents["default"])(_behaviors.UnstyledButton).withConfig({
  displayName: "EllipsisButtonWrapper",
  componentId: "sc-1yh7h75-0"
})(["display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background-color:", ";", " ", "{box-shadow:", ",", " ", ";}&:hover{background:", ";}&:active{background:", ";}"], (0, _branding.getPaletteColor)('white'), (0, _focus.getBaseFocusState)({}), _focus.FOCUS_VISIBLE_SELECTOR, _focus.focusedBoxShadow, _focus.focusedBorderShadow, _focus.focusedBorderColor, _focus.hoverBackgroundColor, _focus.activeBackgroundColor);

var EllipsisButton = function EllipsisButton(_ref) {
  var onClick = _ref.onClick,
      restProps = _objectWithoutProperties(_ref, ["onClick"]);

  return /*#__PURE__*/_react["default"].createElement(EllipsisButtonWrapper, _extends({
    "aria-haspopup": true,
    insetFocus: true,
    onClick: onClick
  }, restProps), /*#__PURE__*/_react["default"].createElement(_index.Ellipsis, {
    "aria-hidden": true,
    colorName: "white"
  }));
};

exports.EllipsisButton = EllipsisButton;