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:
Тимур Городецкий
2026-08-25 18:28:50 +05:00
parent 2958ab7320
commit fa6fe8dbe1
20 changed files with 740 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { useState } from 'react';
import { Checkbox } from './Checkbox';
const meta: Meta<typeof Checkbox> = {
title: 'Поля/Checkbox',
component: Checkbox,
tags: ['autodocs'],
};
export default meta;
export const Default: StoryObj<typeof Checkbox> = {
render: () => {
const [c, setC] = useState(false);
return <Checkbox checked={c} onChange={setC} label="Согласен" />;
},
};
export const States: StoryObj<typeof Checkbox> = {
render: () => (
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
<Checkbox checked={false} onChange={() => undefined} label="Не выбран" />
<Checkbox checked onChange={() => undefined} label="Выбран" />
<Checkbox checked={false} indeterminate onChange={() => undefined} label="Промежуточный (выбрать все)" />
<Checkbox checked disabled onChange={() => undefined} label="Выбран, недоступен" />
<Checkbox checked={false} disabled onChange={() => undefined} label="Недоступен" />
</div>
),
};
/** В ячейках таблиц — без видимой подписи, с ariaLabel для доступности. */
export const InTableCell: StoryObj<typeof Checkbox> = {
render: () => {
const [c, setC] = useState(true);
return <Checkbox checked={c} onChange={setC} ariaLabel="Выбрать строку" />;
},
};