import React from 'react'; import { QaheraVariant, QaheraSize } from './types'; import { Icon } from './Icon'; export interface ButtonProps extends React.ButtonHTMLAttributes { variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'link' | 'destructive'; tone?: 'default' | 'primary' | 'secondary' | 'info' | 'success' | 'danger' | 'warning' | 'dark' | 'light'; size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; shape?: 'default' | 'rounded' | 'flat' | 'circle'; buttonStyle?: 'solid' | 'gradient' | 'light' | 'outline' | 'outline-light'; isLoading?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; children?: React.ReactNode; } export const Button: React.FC = ({ children, variant = 'primary', tone, size = 'md', shape = 'default', buttonStyle = 'solid', isLoading = false, disabled = false, className = '', iconStart, iconEnd, ...props }) => { const isDisabled = disabled || isLoading; const classes = [ 'qhr-btn', `qhr-btn--${variant}`, `qhr-btn--${size}`, tone ? `qhr-btn--tone-${tone}` : '', shape !== 'default' ? `qhr-btn--${shape}` : '', buttonStyle === 'gradient' ? 'qhr-btn--gradient' : '', buttonStyle === 'light' ? 'qhr-btn--light' : '', buttonStyle === 'outline-light' ? 'qhr-btn--outline-light' : '', isLoading ? 'is-loading' : '', isDisabled ? 'is-disabled' : '', className, ].filter(Boolean).join(' '); return ( ); };