"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.Rotate = Rotate;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _reactTransitionGroup = require("react-transition-group");
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/Rotate/Rotate.tsx";
function Rotate({
  children,
  timeout,
  deg: degProp,
  ...rest
}) {
  const {
    type: Component,
    props: childProps
  } = children;
  return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, (0, _extends2.default)({
    timeout: timeout
  }, rest, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 22,
      columnNumber: 5
    }
  }), status => {
    const deg = status === 'exited' || status === 'exiting' ? degProp : 0;
    const style = {
      transitionProperty: 'transform',
      transitionDuration: `${timeout}ms`,
      transitionTimingFunction: 'ease-in',
      transform: `rotate(${deg}deg)`,
      ...rest.style,
      ...childProps.style
    };
    return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, childProps, {
      className: (0, _classnames.default)(childProps.className, rest.className),
      style: style,
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 36,
        columnNumber: 11
      }
    }));
  });
}
//# sourceMappingURL=Rotate.js.map