-
Notifications
You must be signed in to change notification settings - Fork 0
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 #15 from bootwindproject/feat/datadisplay
feat: data display example
- Loading branch information
Showing
9 changed files
with
138 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { cn } from "@bootwind/common" | ||
import { ReactNode } from "react" | ||
|
||
export interface TooltipContentProps { | ||
children: string | ReactNode | ||
className?: string | ||
variant?: "dark" | "light", | ||
position?: "top" | "bottom" | "right" | "left"; | ||
|
||
} | ||
|
||
export const TooltipContent = ({ children, className, variant, position = "top" }: TooltipContentProps) => { | ||
const positionClasses = { | ||
right: 'left-full top-1/2 z-20 ml-3 -translate-y-1/2', | ||
top: 'bottom-full left-1/2 z-20 mb-3 -translate-x-1/2', | ||
left: 'right-full top-1/2 z-20 mr-3 -translate-y-1/2', | ||
bottom: 'left-1/2 top-full z-20 mt-3 -translate-x-1/2', | ||
} | ||
const classes = cn( | ||
'tooltip-content hidden absolute rounded whitespace-nowrap w-auto px-4 py-[6px] text-center text-sm font-semibold shadow-slate-300', | ||
variant === 'dark' ? 'bg-[#2D3643] text-white' : 'bg-[#E9EFF6] text-slate-600', | ||
positionClasses[position] | ||
) | ||
return ( | ||
<div className={classes}> | ||
{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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ReactNode } from "react" | ||
|
||
export interface TooltipTriggerProps { | ||
children: string | ReactNode | ||
} | ||
|
||
export const TooltipTrigger = ({children}: TooltipTriggerProps) => ( | ||
<div className="tooltip-trigger inline-flex " >{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
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,51 @@ | ||
import { Meta } from "@storybook/react"; | ||
import { Card } from '@bootwind/card' | ||
import { Table, TableBody, TableCell, TableRow } from '@bootwind/table' | ||
import { HiPaperClip } from 'react-icons/hi2' | ||
|
||
export default { | ||
title: 'Examples/DataDisplay', | ||
argTypes: {}, | ||
} as Meta; | ||
|
||
export const CardWithTable = () => { | ||
return ( | ||
<Card noPadding title="Applicant Information" className="max-w-[800px] overflow-hidden" subtitle="Personal details and application." cardHeaderBorder> | ||
<Table variant="striped"> | ||
<TableBody> | ||
<TableRow> | ||
<TableCell>Full name</TableCell> | ||
<TableCell>Margot Foster</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Application for</TableCell> | ||
<TableCell>Email address</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell width={200}>Salary expecatation</TableCell> | ||
<TableCell>$120,000</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>About</TableCell> | ||
<TableCell>Fugiat ipsum ipsum deserunt culpa aute sint do nostrud anim incididunt cillum culpa consequat. Excepteur qui ipsum aliquip consequat sint. Sit id mollit nulla mollit nostrud in ea officia proident. Irure nostrud pariatur mollit ad adipisicing reprehenderit deserunt qui eu. </TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Attachments</TableCell> | ||
<TableCell> | ||
<ul> | ||
<li className="flex between items-center gap-2 justify-between"> | ||
<div className="name flex items-center"> | ||
<HiPaperClip/> | ||
<span>resume_backend_developer.zip</span> | ||
</div> | ||
<a href="#">Download</a> | ||
</li> | ||
</ul> | ||
</TableCell> | ||
</TableRow> | ||
</TableBody> | ||
</Table> | ||
</Card> | ||
) | ||
} | ||
|
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