-
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.
- Loading branch information
Showing
6 changed files
with
799 additions
and
0 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,26 @@ | ||
import { cn, tcva, type VariantProps } from "@nyanpasu/material-design-libs"; | ||
|
||
export const dialogOverlayClassName = cn( | ||
"fixed inset-0 z-50", | ||
"backdrop-blur-xl", | ||
"bg-opacity-10 bg-primary", | ||
); | ||
|
||
export const dialogContainerClassName = cn( | ||
"fixed inset-0 z-50 grid place-items-center", | ||
); | ||
|
||
export const dialogContentVariants = tcva(["bg-surface"], { | ||
variants: { | ||
fullScreen: { | ||
true: "fixed inset-0", | ||
false: "min-w-96 rounded-3xl shadow", | ||
}, | ||
}, | ||
defaultVariants: { | ||
fullScreen: false, | ||
}, | ||
}); | ||
|
||
export interface DialogContentVariantsProps | ||
extends VariantProps<typeof dialogContentVariants> {} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./button"; | ||
export * from "./dialog"; |
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,172 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { motion } from "framer-motion"; | ||
import React from "react"; | ||
import { Button } from "../button"; | ||
import { | ||
Dialog, | ||
DialogClose, | ||
DialogContent, | ||
DialogFooter, | ||
DialogHeader, | ||
DialogTrigger, | ||
} from "./"; | ||
|
||
type Story = StoryObj<typeof Dialog>; | ||
|
||
export default { | ||
title: "Components/Dialog", | ||
component: Dialog, | ||
} as Meta<typeof Dialog>; | ||
|
||
export const Default: Story = { | ||
decorators: [ | ||
() => ( | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Button asChild> | ||
<motion.button>open dialog</motion.button> | ||
</Button> | ||
</DialogTrigger> | ||
|
||
<DialogContent | ||
contentPrefix={<DialogHeader>Nyanpasu</DialogHeader>} | ||
contentSuffix={ | ||
<DialogFooter> | ||
<Button variant="flat">Submit</Button> | ||
<DialogClose>Close</DialogClose> | ||
</DialogFooter> | ||
} | ||
> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
</DialogContent> | ||
</Dialog> | ||
), | ||
], | ||
}; | ||
|
||
export const FullScreen: Story = { | ||
decorators: [ | ||
() => ( | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Button asChild> | ||
<motion.button>open dialog</motion.button> | ||
</Button> | ||
</DialogTrigger> | ||
|
||
<DialogContent | ||
fullScreen | ||
contentPrefix={<DialogHeader>Nyanpasu</DialogHeader>} | ||
contentSuffix={ | ||
<DialogFooter> | ||
<Button variant="flat">Submit</Button> | ||
<DialogClose>Close</DialogClose> | ||
</DialogFooter> | ||
} | ||
> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
<div>my content</div> | ||
</DialogContent> | ||
</Dialog> | ||
), | ||
], | ||
}; |
Oops, something went wrong.