fa6fe8dbe1
Набор B перекраски форм: брендовые адаптивные примитивы + иконки arrow-up/arrow-down/swap/refresh + токен $amber-50. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { useState } from 'react';
|
|
import { Dialog } from './Dialog';
|
|
import { Button } from '../Button/Button';
|
|
import { TextArea } from '../TextArea/TextArea';
|
|
import { IconSprite } from '../Icon/IconSprite';
|
|
|
|
const meta: Meta<typeof Dialog> = {
|
|
title: 'Оверлеи/Dialog',
|
|
component: Dialog,
|
|
tags: ['autodocs'],
|
|
decorators: [
|
|
(Story) => (
|
|
<>
|
|
<IconSprite />
|
|
<Story />
|
|
</>
|
|
),
|
|
],
|
|
};
|
|
|
|
export default meta;
|
|
|
|
export const DecisionForm: StoryObj<typeof Dialog> = {
|
|
render: () => {
|
|
const [open, setOpen] = useState(true);
|
|
const [comment, setComment] = useState('');
|
|
return (
|
|
<>
|
|
<Button onClick={() => setOpen(true)}>Открыть диалог</Button>
|
|
<Dialog
|
|
open={open}
|
|
title="Отклонить СТ"
|
|
subText="Укажите причину отклонения (обязательно)."
|
|
onDismiss={() => setOpen(false)}
|
|
footer={
|
|
<>
|
|
<Button variant="secondary" onClick={() => setOpen(false)}>Отмена</Button>
|
|
<Button onClick={() => setOpen(false)}>Отклонить</Button>
|
|
</>
|
|
}
|
|
>
|
|
<TextArea value={comment} onChange={setComment} placeholder="Причина…" />
|
|
</Dialog>
|
|
</>
|
|
);
|
|
},
|
|
};
|