dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

Fixed `Badge` typing for `label` #2091

Closed Mil4n0r closed 1 week ago

Mil4n0r commented 1 week ago

Checklist (Check off all the items before submitting)

Description Type shown in the documentation for the label prop inside Badge component was wrong. It can be either string or number based on the mode (string for contextual, number for notification)

Additional context The typing has been slightly modified for notification mode to use "" in case of not wanting to display content inside, instead of having to work with a possibly undefined value, allowing label to have a default value of "" just like it is done in, for example Button component. Changing the typing of the notification mode in the code was not required