function getRotation(iconDirection, newDirection) {
  if (!iconDirection || !newDirection) {
    return '0deg';
  }
  const rotations = { right: 90, down: 180, left: 270, up: 360 };
  const degrees = rotations[newDirection] - rotations[iconDirection];
  return `${degrees}deg`;
}
Calculates rotation for icons that have a `direction` property configured
in the imported icon definition object. If no direction is configured, a
neutral rotation value is returned.

Returned value is a string of shape `${degrees}deg`, for use in a CSS
transform.