feat: ui components

This commit is contained in:
2025-06-04 14:59:10 +03:00
parent cb799f8057
commit 8085b3bbde
25 changed files with 475 additions and 213 deletions

View File

@@ -1,5 +1,11 @@
import s from './button.module.scss';
import { FunctionComponent, HTMLAttributes, ReactNode, SVGProps } from 'react';
import {
ButtonHTMLAttributes,
DetailedHTMLProps,
FunctionComponent,
ReactNode,
SVGProps,
} from 'react';
import { clsx } from 'clsx';
type ButtonProps = {
@@ -9,7 +15,11 @@ type ButtonProps = {
Icon?: FunctionComponent<SVGProps<SVGSVGElement>>;
onClick?: () => void;
variant?: 'default' | 'orange' | 'ghost';
} & HTMLAttributes<HTMLButtonElement>;
fullWidth?: boolean;
} & DetailedHTMLProps<
ButtonHTMLAttributes<HTMLButtonElement>,
HTMLButtonElement
>;
export default function Button({
className,
@@ -18,6 +28,7 @@ export default function Button({
Icon,
disabled,
variant = 'default',
fullWidth = false,
...props
}: ButtonProps) {
return (
@@ -26,6 +37,7 @@ export default function Button({
s.Button,
disabled && s.Button_disabled,
s['Button_' + variant],
fullWidth && s.Button_fullWidth,
className,
)}
onClick={onClick}