mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-29 04:44:23 +01:00
migrated embed
This commit is contained in:
98 files changed
+1979
-1376
No files matched your search
@@ -32,9 +32,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.text {
|
||||
display: block;
|
||||
}
|
||||
&[data-controlled="false"]:hover .text,
|
||||
.text[data-open="true"] {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,26 @@ interface Props extends ComponentProps<"div"> {
|
||||
children: ReactNode;
|
||||
tooltip: string;
|
||||
side?: "top" | "left";
|
||||
|
||||
// Controls visibility instead of hover when defined
|
||||
open?: boolean;
|
||||
}
|
||||
|
||||
export function Tooltip({
|
||||
children,
|
||||
tooltip,
|
||||
side = "top",
|
||||
open,
|
||||
className,
|
||||
...props
|
||||
}: Props) {
|
||||
return (
|
||||
<div className={classNames(styles.tooltip, className)} {...props}>
|
||||
<div className={styles.text} data-side={side}>
|
||||
<div
|
||||
className={classNames(styles.tooltip, className)}
|
||||
data-controlled={open !== undefined}
|
||||
{...props}
|
||||
>
|
||||
<div className={styles.text} data-side={side} data-open={open}>
|
||||
{tooltip}
|
||||
</div>
|
||||
{children}
|
||||
|
||||
Reference in new issue
Block a user