import { AlertCard } from "./index"; import { DocsPage } from "@shared/stories/DocsTemplate"; import type { Meta, StoryObj } from "@storybook/react"; const meta: Meta = { title: "Components/AlertCard", component: AlertCard, tags: ["autodocs"], parameters: { layout: "centered", docs: { page: DocsPage, description: { component: "An alert card component for displaying error messages and critical information with an icon and responsive layout.", }, }, }, argTypes: { errorMessage: { control: { type: "text" }, description: "Error message or content to display", }, className: { control: { type: "text" }, description: "Additional CSS classes", }, textVariant: { control: { type: "text" }, description: "Text variant class name", }, }, args: { errorMessage: "This is an error message that needs your attention.", }, }; export default meta; type Story = StoryObj; // Default alert card export const Default: Story = { args: {}, }; // Short error message export const ShortMessage: Story = { args: { errorMessage: "Error occurred", }, }; // Long error message export const LongMessage: Story = { args: { errorMessage: "This is a longer error message that demonstrates how the alert card handles extended text content. The layout will adapt responsively to accommodate the message length.", }, }; // Custom text variant export const CustomTextVariant: Story = { args: { errorMessage: "Error with custom text styling", textVariant: "body1", }, }; // With React node content export const WithReactNode: Story = { args: { errorMessage: (

Error occurred while processing your request.

Please try again or contact support if the issue persists.

), }, }; // Responsive layout export const Responsive: Story = { render: () => (

Mobile Layout (flex-col)

Desktop Layout (flex-row)

), parameters: { docs: { description: { story: "Alert card adapts its layout responsively - vertical on mobile, horizontal on desktop.", }, }, }, }; // Custom styling export const CustomStyling: Story = { args: { errorMessage: "Alert card with custom styling", className: "rounded-lg shadow-lg", }, }; // Multiple alert cards export const Multiple: Story = { render: () => (
), parameters: { docs: { description: { story: "Multiple alert cards displayed together.", }, }, }, }; // All variants showcase export const AllVariants: Story = { render: () => (

Default Alert Card

Long Message

Custom Styled

), parameters: { docs: { description: { story: "Showcase of all alert card variants and states.", }, }, }, };