Skip to content

Commit

Permalink
fix: correct contentWrapperProps type for Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptammergard committed Sep 6, 2023
1 parent a040aa4 commit eaf450a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/einride-ui/src/components/content/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from "@emotion/react"
import styled from "@emotion/styled"
import * as RadixTooltip from "@radix-ui/react-tooltip"
import { CSSProperties, ReactNode } from "react"
import { ComponentPropsWithoutRef, ReactNode } from "react"
import { useTheme } from "../../../hooks/useTheme"
import { MaxInlineSize, MaxWidth, Width } from "../../../lib/theme/props"
import { zIndex } from "../../../lib/zIndex"
Expand All @@ -17,6 +17,11 @@ export interface TooltipProps {
/** The content of the tooltip. */
content: ReactNode

/** Props passed to the tooltip content wrapper element. */
contentWrapperProps?: Omit<ComponentPropsWithoutRef<"div">, "aria-label"> & {
"aria-label"?: string
}

/** Disables tooltip from showing. */
disabled?: boolean

Expand All @@ -32,32 +37,27 @@ export interface TooltipProps {
/** The duration from when the pointer enters the tooltip trigger until the tooltip opens. Default is `0`. */
openDelayDuration?: number

/** The preferred side on which the tooltip should appear. In case of collision it'll appear on the opposite side. */
side?: "top" | "right" | "bottom" | "left"

/** Merges the original component props with the props of the supplied component and change the underlying DOM node. */
triggerAsChild?: boolean

/** Width of the tooltip. */
width?: Width

/** The preferred side on which the tooltip should appear. In case of collision it'll appear on the opposite side. */
side?: "top" | "right" | "bottom" | "left"

/** Props passed to the tooltip content wrapper element */
contentWrapperProps?: {
style?: Omit<CSSProperties, "rotate" | "scale" | "perspective">
}
}

/** Use tooltips to show additional information. */
export const Tooltip = ({
align = "center",
children,
content,
contentWrapperProps,
disabled,
hint,
openDelayDuration = 0,
triggerAsChild,
side = "top",
contentWrapperProps,
triggerAsChild,
...props
}: TooltipProps): React.JSX.Element => {
const theme = useTheme()
Expand Down

0 comments on commit eaf450a

Please sign in to comment.