feat: примитивы Checkbox, Spinner, IconButton, Dialog, Link (0.10.0)
Набор B перекраски форм: брендовые адаптивные примитивы + иконки arrow-up/arrow-down/swap/refresh + токен $amber-50. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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>
|
||||
</>
|
||||
);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user