99 computeTooltipPosition ,
1010 cssTimeToMs ,
1111 clearTimeoutRef ,
12- getBorderWidth ,
13- getBorderColor ,
1412} from 'utils'
1513import type { IComputedPosition } from 'utils'
1614import { useTooltip } from 'components/TooltipProvider'
@@ -98,10 +96,6 @@ const Tooltip = ({
9896 const hoveringTooltip = useRef ( false )
9997 const [ anchorsBySelect , setAnchorsBySelect ] = useState < HTMLElement [ ] > ( [ ] )
10098 const mounted = useRef ( false )
101- const arrowBorderWidth = getBorderWidth ( border )
102- const arrowBorderColor = getBorderColor ( border )
103- const arrowBackground =
104- border && arrowBorderColor ? arrowBorderColor : ( arrowColor ?? 'var(--rt-tooltip-background)' )
10599
106100 /**
107101 * @todo Update when deprecated stuff gets removed.
@@ -932,7 +926,15 @@ const Tooltip = ({
932926 } }
933927 ref = { tooltipRef }
934928 >
935- { actualContent }
929+ < WrapperElement
930+ className = { classNames (
931+ 'react-tooltip-content-wrapper' ,
932+ coreStyles [ 'content' ] ,
933+ styles [ 'content' ] ,
934+ ) }
935+ >
936+ { actualContent }
937+ </ WrapperElement >
936938 < WrapperElement
937939 className = { classNames (
938940 'react-tooltip-arrow' ,
@@ -943,15 +945,13 @@ const Tooltip = ({
943945 ) }
944946 style = { {
945947 ...computedPosition . tooltipArrowStyles ,
948+ background : arrowColor
949+ ? `linear-gradient(to right bottom, transparent 50%, ${ arrowColor } 50%)`
950+ : undefined ,
946951 '--rt-arrow-size' : `${ arrowSize } px` ,
947- '--rt-arrow-background' : arrowBackground ,
948- '--rt-arrow-border-width' : arrowBorderColor ? arrowBorderWidth : '0px' ,
949- '--rt-arrow-border-color' : arrowBorderColor ,
950952 } }
951953 ref = { tooltipArrowRef }
952- >
953- < WrapperElement className = { coreStyles [ 'arrowInner' ] } />
954- </ WrapperElement >
954+ />
955955 </ WrapperElement >
956956 ) : null
957957}
0 commit comments