каркас вроде есть

This commit is contained in:
gorbenko.pavel
2026-07-29 12:30:40 +05:00
parent ad04d9bda4
commit 04f04133f2
114 changed files with 8347 additions and 5143 deletions
@@ -0,0 +1,46 @@
import * as React from 'react';
import styles from './Button.module.scss';
import { Icon, IconName } from './Icon';
export type ButtonVariant = 'primary' | 'accent' | 'secondary' | 'ghost' | 'danger';
export interface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
variant?: ButtonVariant;
size?: 'md' | 'sm';
icon?: IconName;
}
export const Button: React.FC<IButtonProps> = ({
variant = 'secondary',
size = 'md',
icon,
className,
children,
...rest
}) => {
const classes = [styles.btn, styles[variant], size === 'sm' ? styles.sm : '', className]
.filter(Boolean)
.join(' ');
return (
<button type="button" className={classes} {...rest}>
{icon && <Icon name={icon} size="sm" />}
{children}
</button>
);
};
export interface IIconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
icon: IconName;
danger?: boolean;
label: string;
}
export const IconButton: React.FC<IIconButtonProps> = ({ icon, danger, label, className, ...rest }) => {
const classes = [styles.iconButton, danger ? styles.danger : '', className].filter(Boolean).join(' ');
return (
<button type="button" className={classes} aria-label={label} title={label} {...rest}>
<Icon name={icon} size="sm" />
</button>
);
};