next-helios-fe 1.8.53 → 1.8.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -7,10 +7,15 @@ interface TooltipProps {
|
|
7
7
|
content: string | React.ReactNode;
|
8
8
|
options?: {
|
9
9
|
position?: "left" | "right" | "top" | "bottom";
|
10
|
+
enableHover?: boolean;
|
10
11
|
};
|
11
12
|
}
|
12
13
|
|
13
|
-
export const Tooltip: React.FC<TooltipProps> = ({
|
14
|
+
export const Tooltip: React.FC<TooltipProps> = ({
|
15
|
+
children,
|
16
|
+
content,
|
17
|
+
options,
|
18
|
+
}) => {
|
14
19
|
const [visible, setVisible] = useState(false);
|
15
20
|
const [position, setPosition] = useState(options?.position ?? "right");
|
16
21
|
const tooltipRef = useRef<HTMLDivElement | null>(null);
|
@@ -184,7 +189,7 @@ export const Tooltip: React.FC<TooltipProps> = ({ children, content, options })
|
|
184
189
|
ref={tooltipRef}
|
185
190
|
className={`absolute z-50 duration-200 transition-opacity ${
|
186
191
|
visible ? "opacity-100" : "opacity-0 pointer-events-none"
|
187
|
-
}`}
|
192
|
+
} ${options?.enableHover ? "" : "pointer-events-none"}`}
|
188
193
|
style={getTooltipPosition()}
|
189
194
|
>
|
190
195
|
{position === "bottom" && (
|