-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1512 from visualize-admin/feat/joined-dims-metadata
Joined dimensions improvements
- Loading branch information
Showing
11 changed files
with
295 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Theme, Tooltip, TooltipProps, Typography } from "@mui/material"; | ||
import { makeStyles } from "@mui/styles"; | ||
import React from "react"; | ||
|
||
import { Icon } from "@/icons"; | ||
|
||
type InfoIconTooltipProps = { | ||
title: NonNullable<React.ReactNode>; | ||
}; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
tooltip: { width: 180, padding: theme.spacing(1, 2), lineHeight: "18px" }, | ||
icon: { | ||
color: theme.palette.primary.main, | ||
pointerEvents: "auto", | ||
}, | ||
})); | ||
|
||
export const InfoIconTooltip = ( | ||
props: InfoIconTooltipProps & Omit<TooltipProps, "children"> | ||
) => { | ||
const classes = useStyles(); | ||
const { title, componentsProps, ...rest } = props; | ||
|
||
return ( | ||
<Tooltip | ||
arrow | ||
placement="top" | ||
title={ | ||
<Typography variant="caption" color="secondary"> | ||
{title} | ||
</Typography> | ||
} | ||
componentsProps={{ | ||
...componentsProps, | ||
tooltip: { className: classes.tooltip }, | ||
}} | ||
{...rest} | ||
> | ||
<Typography> | ||
<Icon name="infoOutline" size={16} className={classes.icon} /> | ||
</Typography> | ||
</Tooltip> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.