-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
449617e
commit c546119
Showing
7 changed files
with
74 additions
and
24 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { Donut } from 'theme-ui'; | ||
import { HoverBox } from '.'; | ||
|
||
export default { | ||
title: 'Components/HoverBox', | ||
component: HoverBox, | ||
}; | ||
|
||
export const overview = () => ( | ||
<HoverBox label="donut component"> | ||
<Donut value={1 / 2} />, | ||
</HoverBox> | ||
); |
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,23 @@ | ||
/** @jsx jsx */ | ||
import { FC } from 'react'; | ||
import { jsx, Box, Text } from 'theme-ui'; | ||
|
||
export interface HoverBoxProps { | ||
/** | ||
* laabel to be displayed when the box is hovered | ||
*/ | ||
label: string; | ||
} | ||
|
||
/** | ||
* Box component that will fade/outline a label at the bottom | ||
* | ||
*/ | ||
export const HoverBox: FC<HoverBoxProps> = ({ label, children }) => { | ||
return ( | ||
<Box variant="hoverbox.container"> | ||
<Box variant="hoverbox.inner">{children}</Box> | ||
<Text variant="hoverbox.text">{label}</Text> | ||
</Box> | ||
); | ||
}; |
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 @@ | ||
export * from './HoverBox'; |
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