code: function getRect({ position, targetOffset, dimensions, targetRect }) {
    const leftRect = targetRect.left + targetRect.width / 2 - dimensions.width / 2
    const alignedTopY = targetRect.top - dimensions.height - targetOffset
    const alignedBottomY = targetRect.bottom + targetOffset
    const alignedRightX = targetRect.right - dimensions.width
    const alignedLeftRightY =
      targetRect.top + targetRect.height / 2 - dimensions.height / 2
  
    switch (position) {
      case Position.LEFT:
        return makeRect(dimensions, {
          left: targetRect.left - dimensions.width - targetOffset,
          top: alignedLeftRightY
        })
      case Position.RIGHT:
        return makeRect(dimensions, {
          left: targetRect.right + targetOffset,
          top: alignedLeftRightY
        })
      case Position.TOP:
        return makeRect(dimensions, {
          left: leftRect,
          top: alignedTopY
        })
      case Position.TOP_LEFT:
        return makeRect(dimensions, {
          left: targetRect.left,
          top: alignedTopY
        })
      case Position.TOP_RIGHT:
        return makeRect(dimensions, {
          left: alignedRightX,
          top: alignedTopY
        })
      default:
      case Position.BOTTOM:
        return makeRect(dimensions, {
          left: leftRect,
          top: alignedBottomY
        })
      case Position.BOTTOM_LEFT:
        return makeRect(dimensions, {
          left: targetRect.left,
          top: alignedBottomY
        })
      case Position.BOTTOM_RIGHT:
        return makeRect(dimensions, {
          left: alignedRightX,
          top: alignedBottomY
        })
    }
  }
docs: Function that takes in numbers and position and gives the final coords.
  @param {Object} position - the width and height of the viewport.
  @param {Number} targetOffset - offset from the target.
  @param {Object} dimensions — the dimensions of the positioner.
  @param {Object} targetRect — the rect of the target.
  @return {Object} - { x: Number, y: Number }