import React, { useState } from 'react'; import { Dialog } from 'reablocks'; import { DialogHeader } from 'reablocks'; import { DialogContent } from 'reablocks'; import { DialogFooter } from 'reablocks'; import { Button } from 'reablocks'; export default { title: 'Components/Layers/Dialog', component: Dialog }; export const Simple = () => { const [open, setOpen] = useState(false); return (
setOpen(false)}> Whats up Hello
); }; export const WithFooter = () => { const [open, setOpen] = useState(false); return (
setOpen(false)}> Confirm Action

This is notification text. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

); }; export const WithForm = () => { const [open, setOpen] = useState(false); return (
setOpen(false)} size="400px">
{ e.preventDefault(); alert('Form submitted!'); setOpen(false); }} > Edit Profile
); }; export const NoCloseButton = () => { const [open, setOpen] = useState(false); return (
setOpen(false)} showCloseButton={false} > No Close Button

This dialog has no close button in the header.

); }; export const CustomHeader = () => { const [open, setOpen] = useState(false); return (
setOpen(false)}>
🎉 Custom Header Content

You can put any custom content in the header!

); }; export const CustomAnimation = () => { const [open, setOpen] = useState(false); return (
setOpen(false)} animation={{ initial: { opacity: 0, scale: 0.5, rotate: -10 }, animate: { opacity: 1, scale: 1, rotate: 0 }, exit: { opacity: 0, scale: 0.5, rotate: 10 }, transition: { duration: 0.4, type: 'spring', stiffness: 150 } }} > Custom Animation Dialog

This dialog uses custom animation properties.

It scales and rotates while fading in and out.

); };