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
+36
View File
@@ -0,0 +1,36 @@
import * as React from 'react';
import styles from './IconButton.module.scss';
import { Icon } from '../Icon/Icon';
import { IconName } from '../Icon/iconNames';
export interface IIconButtonProps {
icon: IconName;
/** Подсказка (tooltip) и a11y-подпись — обязательна: кнопка без текста. */
title: string;
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
disabled?: boolean;
/** Акцент удаления (красный ховер). */
danger?: boolean;
size?: 'sm' | 'md';
className?: string;
}
/** Кнопка-иконка (удалить/переместить/заменить). Иконка — из общего спрайта. */
export const IconButton: React.FC<IIconButtonProps> = ({
icon,
title,
onClick,
disabled,
danger,
size = 'md',
className
}) => {
const classes = [styles.btn, size === 'sm' ? styles.sm : '', danger ? styles.danger : '', className]
.filter(Boolean)
.join(' ');
return (
<button type="button" className={classes} title={title} aria-label={title} disabled={disabled} onClick={onClick}>
<Icon name={icon} size={size === 'sm' ? 'sm' : 'md'} />
</button>
);
};