import type { Meta, StoryObj } from '@storybook/vue3'; import { ref } from 'vue'; import TitanCard from './TitanCard.vue'; import TitanInput from '../ui/TitanInput.vue'; import TitanDatePicker from '../ui/TitanDatePicker.vue'; import TitanTextarea from '../ui/TitanTextarea.vue'; const meta = { component: TitanCard, title: 'Layout/TitanCard', tags: ['autodocs'], argTypes: { variant: { control: 'select', options: ['default', 'system'], description: 'Card variant - default (white) or system (translucent)', table: { type: { summary: 'string' }, defaultValue: { summary: 'default' }, }, }, title: { control: 'text', description: 'Heading text displayed in the card header', table: { type: { summary: 'string' }, defaultValue: { summary: undefined }, }, }, logo: { control: 'boolean', description: 'Whether to show the Titan logo in the top right', table: { type: { summary: 'boolean' }, defaultValue: { summary: true }, }, }, class: { control: 'text', description: 'Additional CSS classes to apply', table: { type: { summary: 'string' }, defaultValue: { summary: undefined }, }, }, }, parameters: { backgrounds: { default: 'dark-green', values: [ { name: 'dark-green', value: '#003822' }, { name: 'light', value: '#f9fafb' }, ], }, }, } satisfies Meta; export default meta; type Story = StoryObj; /** * Default white card variant with logo and heading. * This is the primary style used in most contexts. */ export const Default: Story = { args: { variant: 'default', title: "Let's start by gathering some basic information for the obituary.", logo: true, }, render: (args) => ({ components: { TitanCard, TitanInput, TitanDatePicker, TitanTextarea }, setup() { const name = ref(''); const dateOfBirth = ref(''); const dateOfDeath = ref(''); const location = ref(''); const notes = ref(''); return { args, name, dateOfBirth, dateOfDeath, location, notes }; }, template: `
`, }), }; /** * System variant with translucent background and white logo. * Used for overlay contexts on dark backgrounds. */ export const System: Story = { args: { variant: 'system', title: "Let's start by gathering some basic information for the obituary.", logo: true, }, render: (args) => ({ components: { TitanCard, TitanInput, TitanDatePicker, TitanTextarea }, setup() { const name = ref(''); const dateOfBirth = ref(''); const dateOfDeath = ref(''); const location = ref(''); const notes = ref(''); return { args, name, dateOfBirth, dateOfDeath, location, notes }; }, template: `
`, }), }; /** * Card without logo for simpler layouts. */ export const WithoutLogo: Story = { args: { variant: 'default', title: 'Simple Card Header', logo: false, }, render: (args) => ({ components: { TitanCard }, setup() { return { args }; }, template: `

This card doesn't display the Titan logo in the top right corner.

`, }), }; /** * Card without title for custom header layouts. */ export const WithoutTitle: Story = { args: { variant: 'default', logo: true, }, render: (args) => ({ components: { TitanCard }, setup() { return { args }; }, template: `

This card has no title, just content. The logo is still visible in the top right.

`, }), }; /** * Card with custom header slot for complex layouts. */ export const CustomHeader: Story = { args: { variant: 'default', logo: true, }, render: (args) => ({ components: { TitanCard }, setup() { return { args }; }, template: `

This demonstrates using the header slot for complete control over the header area.

`, }), }; /** * Card with long content to test overflow and scrolling behavior. */ export const LongContent: Story = { args: { variant: 'default', title: 'Card with Extended Content', logo: true, }, render: (args) => ({ components: { TitanCard }, setup() { return { args }; }, template: `

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.

`, }), }; /** * Minimal content card to test spacing with little content. */ export const MinimalContent: Story = { args: { variant: 'default', title: 'Simple Card', logo: true, }, render: (args) => ({ components: { TitanCard }, setup() { return { args }; }, template: `

Brief message.

`, }), }; /** * Mobile responsive view (320px width). */ export const Mobile: Story = { args: { variant: 'default', title: "Let's start by gathering information", logo: true, }, parameters: { viewport: { defaultViewport: 'mobile1', }, }, render: (args) => ({ components: { TitanCard, TitanInput, TitanDatePicker }, setup() { const name = ref(''); const date = ref(''); return { args, name, date }; }, template: `
`, }), }; /** * Tablet responsive view (768px width). */ export const Tablet: Story = { args: { variant: 'default', title: "Let's start by gathering some basic information", logo: true, }, parameters: { viewport: { defaultViewport: 'tablet', }, }, render: (args) => ({ components: { TitanCard, TitanInput, TitanDatePicker }, setup() { const firstName = ref(''); const lastName = ref(''); const date = ref(''); return { args, firstName, lastName, date }; }, template: `
`, }), }; /** * Interactive playground with all controls. * Use the Controls panel to experiment with different prop combinations. */ export const Playground: Story = { args: { variant: 'default', title: 'Interactive Card', logo: true, }, render: (args) => ({ components: { TitanCard }, setup() { return { args }; }, template: `

Use the controls panel to customize this card's appearance.

`, }), };