Skip to content

Commit 97fe8ce

Browse files
authored
fix: use stacked component styles for tooltip COMPASS-8299 (#7413)
1 parent beddbfb commit 97fe8ce

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/compass-components/src/components/leafygreen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import LeafyGreenTextInput from '@leafygreen-ui/text-input';
7373
import { SearchInput } from '@leafygreen-ui/search-input';
7474
export { usePrevious, useMergeRefs } from '@leafygreen-ui/hooks';
7575
import Toggle from '@leafygreen-ui/toggle';
76-
import Tooltip from '@leafygreen-ui/tooltip';
76+
import LGTooltip from '@leafygreen-ui/tooltip';
7777
import {
7878
H1,
7979
H2,
@@ -92,8 +92,10 @@ import {
9292
ComboboxOption,
9393
ComboboxGroup,
9494
} from '@leafygreen-ui/combobox';
95+
import { withStackedComponentStyles } from '../hooks/use-stacked-component';
9596

9697
// 2. Wrap and make any changes/workaround to leafygreen components.
98+
const Tooltip = withStackedComponentStyles(LGTooltip);
9799
const Icon = ({
98100
size,
99101
...rest

packages/compass-components/src/hooks/use-stacked-component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ type StackedComponentProps<T extends boolean> = T extends true
3232

3333
// TODO(LG-4109): This should be eventually supported by the LG design system
3434
export const withStackedComponentStyles = function <ComponentProps>(
35-
WrappedComponent: ComponentType<ComponentProps>
36-
): ComponentType<ComponentProps> {
35+
WrappedComponent: React.FC<ComponentProps>
36+
): React.FC<ComponentProps> {
3737
const ComponentWithStackedStyles = (
3838
props: ComponentProps,
3939
ref: ForwardedRef<ComponentType<ComponentProps>>

0 commit comments

Comments
 (0)