Skip to content

Commit

Permalink
fix: reduced tooltip appearance delay, removed styling options form t…
Browse files Browse the repository at this point in the history
…ooltip (#276)
  • Loading branch information
nstolpe committed Jan 8, 2024
1 parent 9fa7d43 commit 75d4a82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/components/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@ interface TooltipProps {
side?: TooltipPrimitive.TooltipContentProps['side']
content?: React.ReactNode
sideOffset?: number
className?: string
}

const Tooltip = React.forwardRef<
React.ElementRef<typeof TooltipPrimitive.Content>,
TooltipProps
>(({ children, side, content, sideOffset, className }, ref) => {
>(({ children, side, content, sideOffset }, ref) => {
return (
<TooltipPrimitive.Provider>
<TooltipPrimitive.Root>
<TooltipPrimitive.Root delayDuration={100}>
<TooltipPrimitive.Trigger>{children}</TooltipPrimitive.Trigger>
<TooltipPrimitive.Content
side={side ?? 'top'}
sideOffset={sideOffset ?? 4}
className={cn(tooltipVariants(), className)}
className={cn(tooltipVariants())}
ref={ref}
>
{content}
Expand Down
2 changes: 0 additions & 2 deletions stories/Tooltip/Docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ By default, the colour of the tooltip will be `primary-700`, above the child ele
## Right side, no offset

<Canvas of={TooltipStories.RightSideNoOffset} />
## Bottom side, different colour
<Canvas of={TooltipStories.BottomChangeColour} />

## Pass a Component into the Tooltip

Expand Down
7 changes: 0 additions & 7 deletions stories/Tooltip/Tooltip.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ export const RightSideNoOffset: Story = {
}
}

export const BottomChangeColour: Story = {
args: {
side: 'bottom',
className:
'fill-secondary-700 bg-secondary-700 dark:fill-secondary-700 dark:bg-secondary-700 dark:text-foreground-inverse'
}
}
export const PassComponentIntoContent: Story = {
args: {
componentAsContent: true
Expand Down

0 comments on commit 75d4a82

Please sign in to comment.