-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use composable tooltip, revert DefaultTooltip changes
- Loading branch information
Showing
8 changed files
with
83 additions
and
79 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,18 @@ | ||
import { cx } from "../common/utils"; | ||
|
||
type ContentProps = React.HTMLProps<HTMLDivElement>; | ||
|
||
export const ChartTooltipContent: React.FC<ContentProps> = ({ | ||
children, | ||
className, | ||
...rest | ||
}) => { | ||
return ( | ||
<div | ||
className={cx(className, "bg-gray-900 px-3 py-2 rounded-md")} | ||
{...rest} | ||
> | ||
{children} | ||
</div> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
export const ChartTooltipTitle: React.FC<{ children: React.ReactNode }> = ({ children }) => ( | ||
<p className="text-xs text-gray-400">{children}</p> | ||
import { cx } from "../common/utils.ts"; | ||
|
||
type ChartTooltipTitleProps = React.HTMLProps<HTMLParagraphElement>; | ||
|
||
export const ChartTooltipTitle: React.FC<ChartTooltipTitleProps> = ({ | ||
children, | ||
className, | ||
...rest | ||
}) => ( | ||
<p className={cx(className, "text-xs text-gray-400")} {...rest}> | ||
{children} | ||
</p> | ||
); |
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 |
---|---|---|
@@ -1,3 +1,13 @@ | ||
export const ChartTooltipValue: React.FC<{ value: string }> = ({ value }) => ( | ||
<p className="text-sm text-white">{value}</p> | ||
); | ||
import { cx } from "../common/utils.ts"; | ||
|
||
type ChartTooltipValueProps = React.HTMLProps<HTMLParagraphElement>; | ||
|
||
export const ChartTooltipValue: React.FC<ChartTooltipValueProps> = ({ | ||
children, | ||
className, | ||
...rest | ||
}) => ( | ||
<p className={cx(className, "text-sm text-white gap-1 flex")} {...rest}> | ||
{children} | ||
</p> | ||
); |
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
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