@@ -6,9 +6,8 @@ import { Placement } from '@popperjs/core/lib/enums';
6
6
import { variant } from 'styled-system' ;
7
7
import { Colors , MediaQueries } from '../../essentials' ;
8
8
import { get } from '../../utils/themeGet' ;
9
- import { deprecatedProperty } from '../../utils/deprecatedProperty' ;
10
9
import { Text } from '../Text/Text' ;
11
- import { TooltipPlacement , TOOLTIP_TO_POPPER_PLACEMENT_MAP } from './TooltipPlacement' ;
10
+ import { mapPlacementWithDeprecationWarning , TooltipPlacement } from './TooltipPlacement' ;
12
11
13
12
const fadeAnimation = keyframes `
14
13
from {
@@ -137,14 +136,6 @@ interface TooltipProps {
137
136
alwaysVisible ?: boolean ;
138
137
}
139
138
140
- // TODO: Find the right place
141
- const mapWithDeprecationWarning = ( placement : TooltipPlacement | Placement ) : Placement => {
142
- const mappedPlacement = TOOLTIP_TO_POPPER_PLACEMENT_MAP [ placement as TooltipPlacement ] ;
143
- if ( mappedPlacement )
144
- deprecatedProperty ( 'Tooltip' , placement , `Value '${ placement } ' for placement` , mappedPlacement ) ;
145
- return mappedPlacement ?? ( placement as Placement ) ;
146
- } ;
147
-
148
139
const Tooltip : React . FC < TooltipProps > = ( {
149
140
content,
150
141
children,
@@ -165,7 +156,7 @@ const Tooltip: React.FC<TooltipProps> = ({
165
156
* without introduce any breaking changes to the Tooltip component.
166
157
* TODO: Remove in the next major release.
167
158
*/
168
- const mappedPlacement = mapWithDeprecationWarning ( placement ) ;
159
+ const mappedPlacement = mapPlacementWithDeprecationWarning ( placement ) ;
169
160
170
161
const { styles, attributes } = usePopper ( triggerReference , contentReference , {
171
162
placement : mappedPlacement ,
0 commit comments