Created
April 1, 2019 07:38
-
-
Save pradumangoyal/5dc363a782bf18f84294956b2a78f426 to your computer and use it in GitHub Desktop.
Props proposal for Badge component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const propTypes = { | |
| /** | |
| * Change badge color and that of text accordingly | |
| */ | |
| color: PropTypes.oneOf(['inverse', 'lightest']), | |
| /** | |
| * CSS classes that are applied to the span. | |
| */ | |
| className: PropTypes.oneOfType([ | |
| PropTypes.array, | |
| PropTypes.object, | |
| PropTypes.string, | |
| ]), | |
| /** | |
| * Name of the icon category. Visit <a href="http://www.lightningdesignsystem.com/resources/icons">Lightning Design System Icons</a>to reference icon categories. | |
| */ | |
| iconCategory: requiredIf( | |
| PropTypes.oneOf(['action', 'custom', 'doctype', 'standard', 'utility']), | |
| (props) => !!props.iconName | |
| ), | |
| /** | |
| * CSS classes to be added to icon. | |
| */ | |
| iconClassName: PropTypes.oneOfType([ | |
| PropTypes.array, | |
| PropTypes.object, | |
| PropTypes.string, | |
| ]), | |
| /** | |
| * Name of the icon. Visit <a href="http://www.lightningdesignsystem.com/resources/icons">Lightning Design System Icons</a> to reference icon names. | |
| */ | |
| iconName: PropTypes.string, | |
| /** | |
| * Path to the icon. This will override any global icon settings. | |
| */ | |
| iconPath: PropTypes.string, | |
| /** | |
| * Position of the icon. If omitted icon will be positioned to the left. | |
| */ | |
| iconPosition: PropTypes.oneOf(['left', 'right']), | |
| /** | |
| * HTML id applied on the badge span. | |
| */ | |
| id: PropTypes.string, | |
| /** | |
| * Description of icon if required. | |
| */ | |
| iconTite: PropTypes.string, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment