Skip to content

Commit e182039

Browse files
authored
fix: tooltip content type
1 parent 4bf8f50 commit e182039

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

components/Tooltip/Tooltip.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const HeadingOption = (
6161
);
6262

6363
NodeContent.args = {
64-
// @ts-ignore
6564
content: WarningOption,
6665
};
6766

@@ -77,9 +76,8 @@ NodeContent.argTypes = {
7776
};
7877

7978
export const Bubble: StoryFn<typeof TooltipForStory> = (args) => (
80-
<TooltipForStory {...args} content="This is a green bubble">
79+
<TooltipForStory {...args} content={<Text css={{ color: 'black' }}>This is a green bubble</Text>}>
8180
<BubbleComponent variant="green" size="large" />
8281
</TooltipForStory>
8382
);
84-
8583
export default Component;

components/Tooltip/Tooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Box } from '../Box';
66
import { Text } from '../Text';
77

88
export type TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> &
9-
React.ComponentProps<typeof TooltipPrimitive.Content> & {
9+
Omit<React.ComponentProps<typeof TooltipPrimitive.Content>, 'content'> & {
1010
children: React.ReactElement | React.ReactNode;
1111
content: React.ReactElement | React.ReactNode;
1212
multiline?: boolean;
@@ -44,7 +44,7 @@ export const TooltipContent = React.forwardRef<
4444
side="top"
4545
align="center"
4646
sideOffset={5}
47-
{...props}
47+
{...(props as React.ComponentProps<typeof TooltipPrimitive.Content>)}
4848
multiline={multiline}
4949
ref={forwardedRef}
5050
>

0 commit comments

Comments
 (0)