fix(lsd-react): fix Button typography styles

This commit is contained in:
Hossein Mehrabi 2023-12-12 12:35:47 +03:30
parent e3a5c770b2
commit cdfb9d468e
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1

View File

@ -5,8 +5,9 @@ import {
omitCommonProps, omitCommonProps,
useCommonProps, useCommonProps,
} from '../../utils/useCommonProps' } from '../../utils/useCommonProps'
import { buttonClasses } from './Button.classes'
import { useButtonGroupContext } from '../ButtonGroup/ButtonGroup.context' import { useButtonGroupContext } from '../ButtonGroup/ButtonGroup.context'
import { Typography } from '../Typography'
import { buttonClasses } from './Button.classes'
export type ButtonProps = CommonProps & export type ButtonProps = CommonProps &
React.ButtonHTMLAttributes<HTMLButtonElement> & { React.ButtonHTMLAttributes<HTMLButtonElement> & {
@ -49,7 +50,13 @@ export const Button: React.FC<ButtonProps> & {
icon && buttonClasses.withIcon, icon && buttonClasses.withIcon,
)} )}
> >
<span className={buttonClasses.text}>{children}</span> <Typography
component="span"
className={buttonClasses.text}
variant={size === 'small' ? 'label2' : 'label1'}
>
{children}
</Typography>
{icon && <span className={buttonClasses.icon}>{icon}</span>} {icon && <span className={buttonClasses.icon}>{icon}</span>}
</button> </button>
</> </>