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' const meta = { title: 'Base/Admonition', component: Admonition, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { args: { body: 'This is an informational message.', }, } export const AllTypes: Story = { render: () => ({ components: { Admonition }, template: /*html*/ `
`, }), } export const WithHeader: Story = { args: { type: 'warning', header: 'Important Notice', body: 'Please read this carefully before proceeding.', }, } export const Success: Story = { args: { type: 'success', header: 'Operation Complete', body: 'Everything went smoothly.', }, } export const Dismissible: Story = { args: { type: 'info', header: 'Dismissible Notice', body: 'This admonition can be dismissed by clicking the X button.', dismissible: true, }, } export const HeaderWithTimestamp: Story = { render: () => ({ components: { Admonition }, setup() { const t = ref(Date.now() - 3600_000) return { t } }, template: /*html*/ ` Saving world data for my-world. `, }), } export const WithTopRightActions: Story = { render: () => ({ components: { Admonition, ButtonStyled }, template: /*html*/ `
Uploading server files... Something went wrong while extracting the archive. All files have been extracted successfully.
`, }), } export const WithProgressBar: Story = { render: () => ({ components: { Admonition, ButtonStyled }, template: /*html*/ `
128 KB / 1.2 MB (45%) 24 MB extracted — config/settings.yml 56 MB extracted Queued and waiting for available bandwidth.
`, }), }