Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Tooltip): added stories #89

Merged
merged 1 commit into from Apr 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
119 changes: 118 additions & 1 deletion src/Tooltip/Tooltip.stories.tsx
Expand Up @@ -9,7 +9,7 @@ export default {
component: Tooltip,
} as Meta

export const Default: Story<TooltipProps> = (args) => {
const Template: Story<TooltipProps> = (args) => {
return (
<div className='my-6'>
<Tooltip {...args}>
Expand All @@ -18,6 +18,123 @@ export const Default: Story<TooltipProps> = (args) => {
</div>
)
}

export const Default = Template.bind({})
Default.args = {
message: 'hello',
}

export const ForceOpen = Template.bind({})
ForceOpen.args = {
message: 'hello',
open: true,
}

export const Bottom = Template.bind({})
Bottom.args = {
message: 'hello',
open: true,
position: 'bottom'
}

export const Left = Template.bind({})
Left.args = {
message: 'hello',
open: true,
position: 'left'
}

export const Right = Template.bind({})
Right.args = {
message: 'hello',
open: true,
position: 'right'
}

export const Colors: Story<TooltipProps> = (args) => {
return (
<div className='flex gap-2 mt-6'>
<Tooltip
{...args}
color='primary'
message='primary'
>
<Button color='primary'>
Primary
</Button>
</Tooltip>

<Tooltip
{...args}
color='secondary'
message='secondary'
>
<Button color='secondary'>
Secondary
</Button>
</Tooltip>

<Tooltip
{...args}
color='accent'
message='accent'
>
<Button color='accent'>
Accent
</Button>
</Tooltip>
</div>
)
}
Colors.args = {
open: true,
}

export const Statuses: Story<TooltipProps> = (args) => {
return (
<div className='flex gap-2 mt-6'>
<Tooltip
{...args}
color='info'
message='info'
>
<Button color='info'>
Info
</Button>
</Tooltip>

<Tooltip
{...args}
color='success'
message='success'
>
<Button color='success'>
Success
</Button>
</Tooltip>

<Tooltip
{...args}
color='warning'
message='warning'
>
<Button color='warning'>
Warning
</Button>
</Tooltip>

<Tooltip
{...args}
color='error'
message='error'
>
<Button color='error'>
Error
</Button>
</Tooltip>
</div>
)
}
Statuses.args = {
open: true,
}