feat: Sidebar + SidebarToggle, адаптивность компонентов (0.2.0)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react-vite';
|
||||
import { Icon } from './Icon';
|
||||
import { ICON_NAMES } from './iconNames';
|
||||
|
||||
const meta: Meta<typeof Icon> = {
|
||||
title: 'Основа/Icon',
|
||||
component: Icon,
|
||||
tags: ['autodocs'],
|
||||
argTypes: {
|
||||
name: { control: 'select', options: [...ICON_NAMES] },
|
||||
size: { control: 'radio', options: ['sm', 'md', 'lg'] },
|
||||
},
|
||||
args: { name: 'send', size: 'md' },
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof Icon>;
|
||||
|
||||
export const Single: Story = {};
|
||||
|
||||
export const AllIcons: Story = {
|
||||
render: () => (
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: 16 }}>
|
||||
{ICON_NAMES.map((n) => (
|
||||
<div key={n} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 6, fontSize: 11 }}>
|
||||
<Icon name={n} size="lg" />
|
||||
<span>{n}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
),
|
||||
};
|
||||
@@ -126,6 +126,9 @@ export const IconSprite: React.FC = () => (
|
||||
<circle cx="11" cy="11" r="7" />
|
||||
<path d="m21 21-4.35-4.35" />
|
||||
</symbol>
|
||||
<symbol id="i-menu" viewBox="0 0 24 24">
|
||||
<path d="M4 6h16M4 12h16M4 18h16" />
|
||||
</symbol>
|
||||
<symbol id="i-warning" viewBox="0 0 24 24">
|
||||
<path d="M12 2 1 21h22z" strokeLinejoin="round" />
|
||||
<path d="M12 9v5M12 17h.01" />
|
||||
|
||||
@@ -29,6 +29,7 @@ export const ICON_NAMES = [
|
||||
'chevron-left',
|
||||
'arrow-left',
|
||||
'search',
|
||||
'menu',
|
||||
'warning',
|
||||
'check',
|
||||
'plus'
|
||||
|
||||
Reference in New Issue
Block a user