Some button prop types should be dependent on other props
Types for the <Button>
component are currently not correct. It would be nice to use proper types, dependent on the presence of the other props. Here's a nice article about how to achieve this.
- Currently
text
is always required, even when it's not being used (when the variant is a circular button – no text is hshown). Whencircular
is true,text
should not be needed (and vice versa). -
circular
androunded
should be mutually exclusive (should not be able to set both at the same time)
I assume there is more cases of these "conditional types", I haven't really paid attention to it until now.