import { AriaAttributes, ComponentType, MouseEventHandler, PropsWithChildren, ReactNode, } from 'react'; import clsx from 'clsx'; import { AutomationTestingProps } from '@/types'; import { Icon } from '@@/Icon'; import './Button.css'; type Type = 'submit' | 'button' | 'reset'; type Color = | 'default' | 'primary' | 'secondary' | 'danger' | 'link' | 'light' | 'dangerlight' | 'warninglight' | 'none'; type Size = 'xsmall' | 'small' | 'medium' | 'large'; export interface Props extends AriaAttributes, AutomationTestingProps { icon?: ReactNode | ComponentType; featherIcon?: boolean; color?: Color; size?: Size; disabled?: boolean; title?: string; className?: string; type?: Type; onClick?: MouseEventHandler; } export function Button({ type = 'button', color = 'primary', size = 'small', disabled = false, className, onClick, title, icon, featherIcon, children, ...ariaProps }: PropsWithChildren) { return ( ); } function getIconSize(size: Size) { switch (size) { case 'xsmall': return 'xs'; case 'medium': return 'md'; case 'large': return 'lg'; case 'small': default: return 'sm'; } } function sizeClass(size?: Size) { switch (size) { case 'large': return 'btn-lg'; case 'medium': return 'btn-md'; case 'xsmall': return 'btn-xs'; default: return 'btn-sm'; } }