import type { StoryObj } from '@storybook/vue3-vite' import { ref } from 'vue' import { Button } from '../../components/base/buttons' import NewModal from '../../components/modal/NewModal.vue' const meta = { title: 'Modal/NewModal', component: NewModal, } export default meta type Story = StoryObj export const Default: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

This is the modal content.

You can put any content here.

`, }), } export const WithActions: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

Are you sure you want to proceed with this action?

`, }), } export const DangerFade: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

Are you sure you want to delete this item? This action cannot be undone.

`, }), } export const WarningFade: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

This action may have unintended consequences. Please review before proceeding.

`, }), } export const Scrollable: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

This is paragraph {{ i }} of scrollable content. The modal will show fade indicators when scrolled.

`, }), } export const MergedHeader: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

Custom Header Area

This modal has the header merged with content and only shows a close button.

`, }), } export const NotClosable: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

This modal cannot be closed by clicking outside or pressing escape.

Only the action button can close it.

`, }), } export const NoPadding: Story = { render: () => ({ components: { NewModal, Button }, setup() { const modalRef = ref | null>(null) const openModal = () => modalRef.value?.show() return { modalRef, openModal } }, template: `

This modal has no default padding on the content area.

`, }), }