"use strict";

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

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

exports.__esModule = true;
exports.SlideLeft = void 0;

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

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

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

var _AnimatedDrawer = require("../AnimatedDrawer");

var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;

var SlideLeft = function SlideLeft(_ref) {
  var isLeft = _ref.isLeft,
      children = _ref.children;
  return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(Slider, {
    isLeft: Boolean(isLeft),
    isAnimatable: isLeft !== null
  }, children));
};

exports.SlideLeft = SlideLeft;
var slideLeft = (0, _styledComponents.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  0% {\n    transform: translateX(0);\n  }\n  100% {\n    transform: translateX(-100%);\n  }\n"])));
var slideRight = (0, _styledComponents.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  0% {\n    transform: translateX(-100%);\n  }\n  100% {\n    transform: translateX(0);\n  }\n"])));

var Container = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  overflow: hidden;\n"])));

var Slider = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  transform: translateX(0);\n\n  ", "\n"])), function (props) {
  if (!props.isAnimatable) return '';

  if (props.isLeft) {
    return (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteralLoose2["default"])(["\n        animation: ", "ms cubic-bezier(0.25, 0.1, 0.25, 1) 0s 1\n          normal forwards running ", ";\n      "])), _AnimatedDrawer.ANIMATION_DURATION, slideLeft);
  }

  return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteralLoose2["default"])(["\n      animation: ", "ms cubic-bezier(0.25, 0.1, 0.25, 1) 0s 1\n        normal forwards running ", ";\n    "])), _AnimatedDrawer.ANIMATION_DURATION, slideRight);
});
//# sourceMappingURL=index.js.map