-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiNotificationBadge] Add success color (#6864)
* add success color to notification badge * add badgeColor to EuiFilterButton * add cl file * [PR feedback] DRY out `badgeColor` type * [Cleanup] Create new color utilities file + set up a shared map of Emotion colors + convert basic EuiBadge to use emotion CSS as opposed to inline styles for named colors - color contrast is already handled automatically by our button utils + misc clean up/linting for various function naming, comments, syntax * Update downstream snapshots * Convert EuiBetaBadge and EuiNotificationBadge to use new `euiBadgeColors` util - this automatically shares (e.g.) `success` and `hollow` styles and makes colors more consistent across multiple badges - this architecture matches how EuiButtons use a separate color map/util to determine color as opposed to each button component having its own color CSS * [docs] Tweak `EuiNotificationBadge` example to show all colors * changelog for refactor --------- Co-authored-by: Cee Chen <[email protected]>
- Loading branch information
1 parent
72751b6
commit 746f3d7
Showing
17 changed files
with
232 additions
and
204 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import React from 'react'; | ||
|
||
import { EuiNotificationBadge } from '../../../../src/components/badge/notification_badge'; | ||
import { EuiFlexGroup, EuiNotificationBadge } from '../../../../src/components'; | ||
|
||
export default () => <EuiNotificationBadge>3</EuiNotificationBadge>; | ||
export default () => ( | ||
<EuiFlexGroup responsive={false} gutterSize="s"> | ||
<EuiNotificationBadge>1</EuiNotificationBadge> | ||
<EuiNotificationBadge color="success">2</EuiNotificationBadge> | ||
<EuiNotificationBadge color="subdued">3</EuiNotificationBadge> | ||
</EuiFlexGroup> | ||
); |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.