const easingOutQuint = (x, t, b, c, d) => c * ((t = t / d - 1) * t * t * t * t + 1) + b;

const scroll = (node, key, target) => {
  const startTime = Date.now();
  const offset    = node[key];
  const gap       = target - offset;
  const duration  = 1000;
  let interrupt   = false;

  const step = () => {
    const elapsed    = Date.now() - startTime;
    const percentage = elapsed / duration;

    if (percentage > 1 || interrupt) {
      return;
    }

    node[key] = easingOutQuint(0, elapsed, offset, gap, duration);
    requestAnimationFrame(step);
  };

  step();

  return () => {
    interrupt = true;
  };
};

export const scrollRight = (node, position) => scroll(node, 'scrollLeft', position);
export const scrollTop = (node) => scroll(node, 'scrollTop', 0);

@@ -620,127 +620,374 @@
 %7D;%0A%0A
-export const scrollRight = (node, position) =%3E scroll(node, 'scrollLeft', position);%0Aexport const scrollTop = (node) =%3E
+const isScrollBehaviorSupported = 'scrollBehavior' in document.documentElement.style;%0A%0Aexport const scrollRight = (node, position) =%3E isScrollBehaviorSupported ? node.scrollTo(%7B left: position, behavior: 'smooth' %7D) : scroll(node, 'scrollLeft', position);%0Aexport const scrollTop = (node) =%3E isScrollBehaviorSupported ? node.scrollTo(%7B top: 0, behavior: 'smooth' %7D) :
  scr

Use ScrollToOptions for smooth scrolling if supported