-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notification): add info icon to notification (#5203)
- Loading branch information
Showing
4 changed files
with
54 additions
and
48 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
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
90 changes: 49 additions & 41 deletions
90
packages/components/src/components/notification/notification.hbs
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,53 +1,61 @@ | ||
<!-- | ||
<!-- | ||
Copyright IBM Corp. 2016, 2018 | ||
This source code is licensed under the Apache-2.0 license found in the | ||
LICENSE file in the root directory of this source tree. | ||
--> | ||
|
||
{{#each items}} | ||
<div data-notification class="{{@root.prefix}}--{{../variant}}-notification {{@root.prefix}}--{{../variant}}-notification--{{type}}{{#if ../lowContrast}} {{@root.prefix}}--{{../variant}}-notification--low-contrast{{/if}}" role="alert"> | ||
{{#is ../variant "toast"}} | ||
{{#is type "error"}} | ||
{{ carbon-icon 'ErrorFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "success"}} | ||
{{ carbon-icon 'CheckmarkFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "warning"}} | ||
{{ carbon-icon 'WarningFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
<div data-notification | ||
class="{{@root.prefix}}--{{../variant}}-notification {{@root.prefix}}--{{../variant}}-notification--{{type}}{{#if ../lowContrast}} {{@root.prefix}}--{{../variant}}-notification--low-contrast{{/if}}" | ||
role="alert"> | ||
{{#is ../variant "toast"}} | ||
{{#is type "error"}} | ||
{{ carbon-icon 'ErrorFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "success"}} | ||
{{ carbon-icon 'CheckmarkFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "warning"}} | ||
{{ carbon-icon 'WarningFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "info"}} | ||
{{ carbon-icon 'InformationFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{/is}} | ||
<div class="{{@root.prefix}}--{{../variant}}-notification__details"> | ||
{{#is ../variant "inline"}} | ||
{{#is type "error"}} | ||
{{ carbon-icon 'ErrorFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "info"}} | ||
{{ carbon-icon 'InformationFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "success"}} | ||
{{ carbon-icon 'CheckmarkFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
<div class="{{@root.prefix}}--{{../variant}}-notification__details"> | ||
{{#is ../variant "inline"}} | ||
{{#is type "error"}} | ||
{{ carbon-icon 'ErrorFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "info"}} | ||
{{ carbon-icon 'InformationFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "success"}} | ||
{{ carbon-icon 'CheckmarkFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
{{#is type "warning"}} | ||
{{ carbon-icon 'WarningFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
<div class="{{@root.prefix}}--{{../variant}}-notification__text-wrapper"> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__title">{{title}}</p> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__subtitle">{{subtitle}}</p> | ||
</div> | ||
{{/is}} | ||
{{#is ../variant "toast"}} | ||
<h3 class="{{@root.prefix}}--{{../variant}}-notification__title">{{title}}</h3> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__subtitle">{{subtitle}}</p> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__caption">{{timestamp}}</p> | ||
{{/is}} | ||
{{#is type "warning"}} | ||
{{ carbon-icon 'WarningFilled20' class=(add @root.prefix (add '--' (add ../variant '-notification__icon'))) }} | ||
{{/is}} | ||
<div class="{{@root.prefix}}--{{../variant}}-notification__text-wrapper"> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__title">{{title}}</p> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__subtitle">{{subtitle}}</p> | ||
</div> | ||
{{#is ../variant "inline"}} | ||
<button tabindex="0" class="{{@root.prefix}}--inline-notification__action-button {{@root.prefix}}--btn {{@root.prefix}}--btn--sm {{@root.prefix}}--btn--ghost" type="button">Action</button> | ||
{{/is}} | ||
<button data-notification-btn class="{{@root.prefix}}--{{../variant}}-notification__close-button" type="button" aria-label="close"> | ||
{{ carbon-icon 'Close20' class=(add @root.prefix (add '--' (add ../variant '-notification__close-icon'))) }} | ||
</button> | ||
{{#is ../variant "toast"}} | ||
<h3 class="{{@root.prefix}}--{{../variant}}-notification__title">{{title}}</h3> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__subtitle">{{subtitle}}</p> | ||
<p class="{{@root.prefix}}--{{../variant}}-notification__caption">{{timestamp}}</p> | ||
{{/is}} | ||
</div> | ||
{{#is ../variant "inline"}} | ||
<button tabindex="0" | ||
class="{{@root.prefix}}--inline-notification__action-button {{@root.prefix}}--btn {{@root.prefix}}--btn--sm {{@root.prefix}}--btn--ghost" | ||
type="button">Action</button> | ||
{{/is}} | ||
<button data-notification-btn class="{{@root.prefix}}--{{../variant}}-notification__close-button" type="button" | ||
aria-label="close"> | ||
{{ carbon-icon 'Close20' class=(add @root.prefix (add '--' (add ../variant '-notification__close-icon'))) }} | ||
</button> | ||
</div> | ||
{{/each}} |
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