import type { Meta, StoryObj } from "@storybook/react" import { Button } from "../../action/button/Button" import { Dialog } from "./Dialog" /** * Displays a modal dialog that overlays the page content. * * ## Props * - `Root`: Container for the dialog * - `Trigger`: Element that opens the dialog * - `Content`: The dialog content container * - `Title`: The dialog title * - `Description`: The dialog description * - `Close`: Button to close the dialog * * ### Content Props * - `size`: "1" | "2" | "3" | "4" (default: "3") * - `width`: string (custom width) * - `height`: string (custom height) * - `minWidth`: string (minimum width) * - `maxWidth`: string (maximum width) * - `minHeight`: string (minimum height) * - `maxHeight`: string (maximum height) * - `align`: "start" | "center" (default: "center") */ const meta = { title: "base/containment/Dialog", component: Dialog.Root, tags: ["autodocs"], parameters: { layout: "centered", }, } satisfies Meta export default meta type Story = StoryObj /** * Basic dialog with title and description. */ export const Default: Story = { render: () => ( Dialog Title This is a basic dialog with a title and description. It demonstrates the fundamental structure of a dialog component.
), } /** * Dialog with different sizes. */ export const Sizes: Story = { render: () => (
Small Dialog This is a small dialog with minimal padding and compact layout.
Medium Dialog This is a medium-sized dialog with balanced padding and spacing.
Large Dialog This is a large dialog with generous padding and comfortable spacing for complex content.
Extra Large Dialog This is an extra large dialog with maximum padding and spacing for very complex content.
), } /** * Dialog with custom width. */ export const CustomWidth: Story = { render: () => (
Narrow Dialog This dialog has a custom narrow width of 300px, perfect for simple confirmations or alerts.
Wide Dialog This dialog has a custom wide width of 600px, allowing for more complex layouts and content.

This extra space can be used for forms, tables, or other complex content that needs more room.

), } /** * Confirmation dialog. */ export const Confirmation: Story = { render: () => ( Confirm Deletion Are you sure you want to delete this item? This action cannot be undone.

Warning: This will permanently remove the item and all associated data.

), } /** * Form dialog. */ export const Form: Story = { render: () => ( Add New User Fill in the details below to create a new user account.
), } /** * Information dialog. */ export const Information: Story = { render: () => ( Project Information Detailed information about the current project and its status.
Project Name: Design System
Status: Active
Created: January 15, 2024
Last Updated: March 20, 2024
Team Members: 12

This project is currently in active development with regular updates and improvements.

), } /** * Alert dialog. */ export const Alert: Story = { render: () => ( Important Notice Your session will expire in 5 minutes. Please save your work to avoid losing any unsaved changes.
⚠️

Warning: Any unsaved changes will be lost when the session expires.

), } /** * Dialog with custom alignment. */ export const CustomAlignment: Story = { render: () => (
Center Aligned Dialog This dialog is center aligned (default behavior).
Start Aligned Dialog This dialog is start aligned, appearing at the top of the viewport.
), }