import type { Meta, StoryObj } from '@storybook/react'
import { Button } from '../Button'
import { Checkbox } from '../Checkbox'
import { Label } from '../Label'
import { Typography } from '../Typography'
import {
Modal,
ModalBody,
ModalClose,
ModalCloseButton,
ModalContent,
ModalDescription,
ModalFooter,
ModalHeader,
ModalTitle,
ModalTrigger,
} from './Modal'
const meta = {
component: Modal,
title: 'Blocks/Modal',
subcomponents: {
ModalTrigger,
ModalContent,
ModalHeader,
ModalTitle,
ModalDescription,
ModalBody,
ModalFooter,
ModalClose,
ModalCloseButton,
},
parameters: {
layout: 'centered',
},
decorators: [
(Story) => (
),
],
argTypes: {
open: { control: 'boolean' },
onOpenChange: { control: false },
},
} satisfies Meta
export default meta
type Story = StoryObj
export const Default: Story = {
render: (_args) => (
Modal TitleModal content goes here
),
}
export const SmallModal: Story = {
render: (_args) => (
Small Modal
This is a small modal with minimal content.
),
}
export const LargeModal: Story = {
render: (_args) => (
Large Modal Title
This is a large modal that demonstrates the maximum width option.
This modal uses the lg size variant, which provides more space for
content. It is useful for displaying forms, tables, or other complex
information that requires additional screen real estate.
),
}
export const WithDividers: Story = {
render: (_args) => (
Modal With Dividers
),
parameters: {
docs: {
description: {
story:
'Use header and footer dividers when modal content needs stronger separation from actions.',
},
},
},
}
export const WithDescription: Story = {
render: (_args) => (
Modal Title
This modal includes a description that provides additional context
below the title.
The description component is useful for providing additional context
or instructions related to the modal purpose.
),
}
export const WithoutCloseButton: Story = {
render: (_args) => (
Modal Title
This modal has no X button in the top-right corner. Users must use
the action buttons below to dismiss it.
Notice that there is no X button in the top-right corner of this
modal. This pattern can be useful when you want to ensure users make
a deliberate choice rather than dismissing the modal without taking
action.
),
parameters: {
docs: {
description: {
story:
'Hide the close button when users must make an explicit choice through the modal actions.',
},
},
},
}