mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
Enhancement: Add disabled prop to Tooltip component
This commit is contained in:
@@ -11,6 +11,7 @@ export type TooltipProps = Omit<TooltipPrimitive.TooltipContentProps, "open" | "
|
|||||||
onOpenChange?: (isOpen: boolean) => void;
|
onOpenChange?: (isOpen: boolean) => void;
|
||||||
defaultOpen?: boolean;
|
defaultOpen?: boolean;
|
||||||
position?: "top" | "bottom" | "left" | "right";
|
position?: "top" | "bottom" | "left" | "right";
|
||||||
|
isDisabled?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Tooltip = ({
|
export const Tooltip = ({
|
||||||
@@ -21,6 +22,7 @@ export const Tooltip = ({
|
|||||||
defaultOpen,
|
defaultOpen,
|
||||||
className,
|
className,
|
||||||
asChild = true,
|
asChild = true,
|
||||||
|
isDisabled,
|
||||||
position = "top",
|
position = "top",
|
||||||
...props
|
...props
|
||||||
}: TooltipProps) => (
|
}: TooltipProps) => (
|
||||||
@@ -43,6 +45,7 @@ data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade
|
|||||||
data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade
|
data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade
|
||||||
data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade
|
data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade
|
||||||
`,
|
`,
|
||||||
|
isDisabled && "!hidden",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user