import * as React from 'react'; import * as AlertDialog from '@radix-ui/react-alert-dialog'; import styles from './alert-dialog.stories.module.css'; export default { title: 'Components/AlertDialog' }; export const Styled = () => ( delete everything Are you sure? This will do a very dangerous thing. Thar be dragons! yolo, do it maybe not ); export const Controlled = () => { const [open, setOpen] = React.useState(false); const [housePurchased, setHousePurchased] = React.useState(false); return (
a large white house with a red roof
{ if (housePurchased) { e.preventDefault(); setHousePurchased(false); } }} > {housePurchased ? 'You bought the house! Sell it!' : 'Buy this house'} Are you sure? Houses are very expensive and it looks like you only have €20 in the bank. Maybe consult with a financial advisor? setHousePurchased(true)}> buy it anyway good point, I'll reconsider
); }; export const Chromatic = () => (

Uncontrolled

Closed

delete everything Title Description Confirm Cancel

Open

delete everything Title Description Confirm Cancel

Uncontrolled with reordered parts

Closed

Title Description Confirm Cancel delete everything

Open

Title Description Confirm Cancel delete everything

Controlled

Closed

delete everything Title Description Confirm Cancel

Open

delete everything Title Description Confirm Cancel

Controlled with reordered parts

Closed

Title Description Confirm Cancel delete everything

Open

Title Description Confirm Cancel delete everything

State attributes

Closed

delete everything Title Description Confirm Cancel

Open

delete everything Title Description Confirm Cancel
); Chromatic.parameters = { chromatic: { disable: false } };