- Inputs: TextField, Select, Checkbox - Surfaces: Surface, Card, Chip, Badge - Feedback: Alert, Dialog, Skeleton, Progress - Financial data: DataTable, Metric, Money, PriceChange - Form & page-state: FormField, FilterBar, EmptyState, ErrorState, LoadingState - MUI CssVarsProvider -> ThemeProvider deprecation fix - Inter font bundled via @fontsource/inter - ESLint no-restricted-imports (warn) for gradual migration - storybook-static gitignored All 268 tests pass (157 design-system + 111 frontend)
70 lines
1.6 KiB
TypeScript
70 lines
1.6 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react';
|
||
import { Button } from '../Button/Button';
|
||
import { Alert } from './Alert';
|
||
|
||
const meta: Meta<typeof Alert> = {
|
||
title: 'Feedback/Alert',
|
||
component: Alert,
|
||
argTypes: {
|
||
severity: {
|
||
control: 'select',
|
||
options: ['info', 'success', 'warning', 'error'],
|
||
},
|
||
title: { control: 'text' },
|
||
},
|
||
};
|
||
|
||
export default meta;
|
||
type Story = StoryObj<typeof Alert>;
|
||
|
||
export const Info: Story = {
|
||
args: {
|
||
severity: 'info',
|
||
title: 'Информация',
|
||
children: 'Данные обновляются каждые 15 минут',
|
||
},
|
||
};
|
||
|
||
export const Success: Story = {
|
||
args: {
|
||
severity: 'success',
|
||
title: 'Успешно',
|
||
children: 'Портфель успешно создан',
|
||
},
|
||
};
|
||
|
||
export const Warning: Story = {
|
||
args: {
|
||
severity: 'warning',
|
||
title: 'Внимание',
|
||
children: 'Цена акции превысила лимит',
|
||
},
|
||
};
|
||
|
||
export const Error: Story = {
|
||
args: {
|
||
severity: 'error',
|
||
title: 'Ошибка',
|
||
children: 'Не удалось загрузить данные',
|
||
},
|
||
};
|
||
|
||
export const WithAction: Story = {
|
||
args: {
|
||
severity: 'warning',
|
||
children: 'Обновите страницу для получения актуальных данных',
|
||
action: (
|
||
<Button size="small" variant="secondary">
|
||
Обновить
|
||
</Button>
|
||
),
|
||
},
|
||
};
|
||
|
||
export const WithoutTitle: Story = {
|
||
args: {
|
||
severity: 'info',
|
||
children: 'Просто информационное сообщение без заголовка',
|
||
},
|
||
};
|