-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(libs/docs): add callout stories
- Loading branch information
1 parent
934bc44
commit 8c752b2
Showing
3 changed files
with
73 additions
and
2 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,69 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { Callout } from 'fumadocs-ui/components/callout' | ||
|
||
const meta: Meta<typeof Callout> = { | ||
title: '📚 Docs Site/Callout', | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
component: Callout, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
type: { | ||
options: ['info', 'warn', 'error'], | ||
control: { type: 'select' }, | ||
description: 'The type of callout (info, warn, error)', | ||
}, | ||
title: { | ||
control: 'text', | ||
description: 'The title of the callout', | ||
}, | ||
children: { | ||
control: 'text', | ||
description: 'The content inside the callout', | ||
}, | ||
}, | ||
} | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof Callout> | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: 'Callout', | ||
type: 'info', | ||
children: 'This is a default callout. You can edit this text.', | ||
}, | ||
render: args => ( | ||
<div> | ||
<Callout {...args}>{args.children}</Callout> | ||
</div> | ||
), | ||
} | ||
|
||
export const Warn: Story = { | ||
args: { | ||
title: 'Warn Callout', | ||
type: 'warn', | ||
children: 'This is a warning callout. Pay attention to this message.', | ||
}, | ||
render: args => ( | ||
<div> | ||
<Callout {...args}>{args.children}</Callout> | ||
</div> | ||
), | ||
} | ||
|
||
export const Error: Story = { | ||
args: { | ||
title: 'Error Callout', | ||
type: 'error', | ||
children: 'This is an error callout. Action may be required.', | ||
}, | ||
render: args => ( | ||
<div> | ||
<Callout {...args}>{args.children}</Callout> | ||
</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