(state: FloatingTooltipState)
| 275 | } |
| 276 | |
| 277 | function getTooltipTranslate(state: FloatingTooltipState): string { |
| 278 | const xOffset = |
| 279 | state.alignX === 'left' ? `${TOOLTIP_OFFSET}px` : `calc(-100% - ${TOOLTIP_OFFSET}px)` |
| 280 | const yOffset = |
| 281 | state.alignY === 'below' ? `${TOOLTIP_OFFSET}px` : `calc(-100% - ${TOOLTIP_OFFSET}px)` |
| 282 | |
| 283 | return `translate3d(${state.x}px, ${state.y}px, 0) translate(${xOffset}, ${yOffset})` |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * Kept for API compatibility with the previous tooltip. The floating tooltip has no shared hover |