-
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.
fix(dialog): Dialog.Content children type unassignable (#13)
* fix(dialog): Dialog.Content children type unassignable * feat(dialog): add dialog stories
- Loading branch information
1 parent
c786e56
commit 44a390d
Showing
3 changed files
with
53 additions
and
13 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,39 @@ | ||
import type { DialogProps } from '@/components/dialog' | ||
import type { Meta, StoryFn } from '@storybook/react' | ||
|
||
import { Button } from '@/components/button' | ||
import { Card } from '@/components/card' | ||
import { Dialog } from '@/components/dialog' | ||
|
||
const Component: Meta<typeof Dialog> = { | ||
title: 'Components/Dialog', | ||
component: Dialog, | ||
} | ||
|
||
const defaultProps = {} | ||
|
||
export const Default: StoryFn = (args: DialogProps) => ( | ||
<Dialog {...args}> | ||
<Button>Open</Button> | ||
|
||
<Dialog.Content> | ||
{({ close }) => ( | ||
<Card> | ||
<Card.Header>Dialog</Card.Header> | ||
|
||
<Card.Body>Dialog Content</Card.Body> | ||
|
||
<Card.Footer> | ||
<Button onPress={close}>Close</Button> | ||
</Card.Footer> | ||
</Card> | ||
)} | ||
</Dialog.Content> | ||
</Dialog> | ||
) | ||
|
||
Default.args = { | ||
...defaultProps, | ||
} | ||
|
||
export default Component |
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