import type { Meta, StoryObj } from "@storybook/react" import React from "react" import { Button } from "../../action/button" import { AlertDialog } from "./AlertDialog" /** * An alert dialog component for important confirmations. * * ## Props * - `Root`: Container for the alert dialog * - `Trigger`: Element that triggers the alert dialog * - `Content`: The alert dialog content * - `Title`: The alert dialog title * - `Description`: The alert dialog description * - `Action`: The primary action button * - `Cancel`: The cancel button */ const meta = { title: "base/containment/AlertDialog", component: AlertDialog.Root, tags: ["autodocs"], parameters: { layout: "centered", }, } satisfies Meta export default meta type Story = StoryObj /** * Basic alert dialog with default settings. */ export const Default: Story = { render: () => ( Are you sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers.
), } /** * Alert dialog with different content types. */ export const ContentTypes: Story = { render: () => (
Delete Item Are you sure you want to delete this item? This action cannot be undone.
Save Changes You have unsaved changes. Do you want to save them before leaving?
Publish Changes This will make your changes visible to all users. Are you ready to publish?
), } /** * Alert dialog with different button variants. */ export const ButtonVariants: Story = { render: () => ( Custom Button Styles This alert dialog demonstrates different button variants and colors.
), } /** * Alert dialog with controlled state. */ export const Controlled: Story = { render: () => { const [open, setOpen] = React.useState(false) return ( Controlled Alert Dialog This alert dialog is controlled by React state. The open state can be managed programmatically.
) }, } /** * Alert dialog with custom styling. */ export const CustomStyling: Story = { render: () => ( Custom Styled Dialog This alert dialog has custom styling with a gradient background and white text.
), } /** * Alert dialog with different sizes. */ export const Sizes: Story = { render: () => (
Small Dialog This is a small alert dialog with minimal content.
Medium Dialog This is a medium-sized alert dialog with more detailed content and description.
Large Dialog This is a large alert dialog with extensive content. It can contain multiple paragraphs and detailed information about the action being confirmed.

Additional context or warnings can be displayed here to help users make an informed decision.

), }