"use strict";var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.FxInputRestoreBtn = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireWildcard(require("react"));

var _ThemeContext = require("../../lib/theming/ThemeContext");
var _Button = require("../Button");

var _useSizeControl = require("../../lib/size/useSizeControl");

var _UndoIcon = require("./UndoIcon");









var FxInputRestoreBtn = exports.FxInputRestoreBtn = function FxInputRestoreBtn(props) {
  var theme = (0, _react.useContext)(_ThemeContext.ThemeContext);
  var size = (0, _useSizeControl.useSizeControl)(props.size);

  var iconSizes = {
    small: parseInt(theme.inputIconSizeSmall),
    medium: parseInt(theme.inputIconSizeMedium),
    large: parseInt(theme.inputIconSizeLarge)
  };
  var cornersSizes = {
    small: {
      borderTopLeftRadius: theme.inputBorderRadiusSmall,
      borderBottomLeftRadius: theme.inputBorderRadiusSmall
    },
    medium: {
      borderTopLeftRadius: theme.inputBorderRadiusMedium,
      borderBottomLeftRadius: theme.inputBorderRadiusMedium
    },
    large: {
      borderTopLeftRadius: theme.inputBorderRadiusLarge,
      borderBottomLeftRadius: theme.inputBorderRadiusLarge
    }
  };
  var buttonCorners = cornersSizes[size];
  var iconUndo = /*#__PURE__*/_react.default.createElement(_UndoIcon.UndoIcon, { size: iconSizes[size] });

  return /*#__PURE__*/(
    _react.default.createElement(_Button.Button, {
      size: props.size,
      onClick: props.onRestore,
      borderless: props.borderless,
      disabled: props.disabled,
      corners: (0, _extends2.default)({
        borderTopRightRadius: 0,
        borderBottomRightRadius: 0 },
      buttonCorners,
      props.corners),

      icon: iconUndo,
      "aria-label": props['aria-label'] }
    ));

};