import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import Admonition from '../../components/base/Admonition.vue'
import ButtonStyled from '../../components/base/ButtonStyled.vue'
import StackedAdmonitionsRaw, {
type StackedAdmonitionItem,
} from '../../components/base/StackedAdmonitions.vue'
// The generic type signature of StackedAdmonitions breaks Storybook's Meta
// inference and Vue's components record type. Cast to `any` for story wiring;
// runtime behavior is unchanged.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const StackedAdmonitions = StackedAdmonitionsRaw as any
interface DemoItem extends StackedAdmonitionItem {
header: string
body: string
}
const meta: Meta = {
title: 'Base/StackedAdmonitions',
component: StackedAdmonitions,
}
export default meta
type Story = StoryObj
const initialItems: DemoItem[] = [
{
id: 'backup-failed',
type: 'critical',
header: 'Backup failed',
body: 'Something went wrong while creating your backup. Try again or contact support.',
},
{
id: 'storage-nearly-full',
type: 'warning',
header: 'Storage nearly full',
body: 'Your server is using 92% of available storage.',
},
{
id: 'scheduled-maintenance',
type: 'info',
header: 'Scheduled maintenance',
body: 'Routine maintenance will begin in 30 minutes.',
},
]
const variedHeightItems: DemoItem[] = [
initialItems[0],
{
id: 'storage-nearly-full',
type: 'warning',
header: 'Storage nearly full',
body: 'Your server is using 92% of available storage. Large world backups, installation artifacts, and cached uploads are all contributing here, so this card is intentionally taller to exercise the collapse animation between mixed-height banners.',
},
initialItems[2],
]
const completedBackupItem: DemoItem = {
id: 'backup-completed',
type: 'success',
header: 'Backup completed',
body: 'Backup 38298832 finished successfully.',
}
export const Empty: Story = {
render: () => ({
components: { StackedAdmonitions, Admonition },
template: /* html */ `