-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
6 changed files
with
356 additions
and
12 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,67 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import Button from '../Button' | ||
import Input from '../Input' | ||
import Label from '../Label' | ||
import { | ||
Dialog, | ||
DialogTrigger, | ||
DialogClose, | ||
DialogContent, | ||
DialogHeader, | ||
DialogFooter, | ||
DialogTitle, | ||
DialogDescription, | ||
} from './Dialog' | ||
|
||
const meta = { | ||
title: 'UI/Dialog', | ||
component: Dialog, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
} satisfies Meta<typeof Dialog> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Normal: Story = { | ||
args: {}, | ||
render: () => { | ||
return ( | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Button variant="primary">Share</Button> | ||
</DialogTrigger> | ||
<DialogContent className="sm:max-w-md"> | ||
<DialogHeader> | ||
<DialogTitle>Share link</DialogTitle> | ||
<DialogDescription> | ||
Anyone who has this link will be able to view this. | ||
</DialogDescription> | ||
</DialogHeader> | ||
<div className="flex items-center space-x-2"> | ||
<div className="grid flex-1 gap-2"> | ||
<Label htmlFor="link" className="sr-only"> | ||
Link | ||
</Label> | ||
<Input | ||
id="link" | ||
defaultValue="https://ui.shadcn.com/docs/installation" | ||
readOnly | ||
/> | ||
</div> | ||
<Button type="submit" className="px-3"> | ||
<span className="sr-only">Copy</span> | ||
</Button> | ||
</div> | ||
<DialogFooter className="sm:justify-start"> | ||
<DialogClose asChild> | ||
<Button type="button" variant="secondary"> | ||
Close | ||
</Button> | ||
</DialogClose> | ||
</DialogFooter> | ||
</DialogContent> | ||
</Dialog> | ||
) | ||
}, | ||
} |
Oops, something went wrong.