Skip to content

Commit

Permalink
Docs: Story for the Alert component #645
Browse files Browse the repository at this point in the history
Docs: Add Alert Story (#645)\n\n- [x] Wrote a Story for the Alert component.\n\nCloses #645
  • Loading branch information
Larocca authored and Larocca committed Nov 7, 2024
1 parent a3b8c27 commit 31107f5
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions components/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import type { Meta, StoryObj } from '@storybook/react';
import { Alert } from './Alert';

const meta: Meta<typeof Alert> = {
title: 'Components/Alert',
component: Alert,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: `The Alert component is a versatile UI element designed to display important messages to users. It is built to handle various types of alerts, each with its own visual style to convey different levels of importance or types of information.`,
},
},
},
argTypes: {
variant: {
options: ['default', 'error', 'warning', 'success'],
control: { type: 'radio' },
description: 'The variant of the alert.',
},
children: {
description: 'Content of the alert message.',
},
},
args: {
children: 'This is an alert message',
},
} satisfies Meta<typeof Alert>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
variant: 'default',
},
};

export const Error: Story = {
args: {
variant: 'error',
children: 'This is an error alert',
},
};

export const Warning: Story = {
args: {
variant: 'warning',
children: 'This is a warning alert',
},
};

export const Success: Story = {
args: {
variant: 'success',
children: 'This is a success alert',
},
};

0 comments on commit 31107f5

Please sign in to comment.