-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(design): add accessibility considerations to the notification co…
…mponent (#2900)
- Loading branch information
Showing
17 changed files
with
184 additions
and
40 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
7 changes: 5 additions & 2 deletions
7
...design/notification/examples/src/default-notification/default-notification.component.html
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,8 +1,11 @@ | ||
<daff-notification> | ||
<button daff-button (click)="toggleNotification()">Show Notification</button> | ||
|
||
<daff-notification *ngIf="showNotification" status="success"> | ||
<fa-icon daffPrefix [icon]="faInfoCircle"></fa-icon> | ||
<div daffNotificationTitle>Title</div> | ||
<div daffNotificationSubtitle>This is the subtitle with information</div> | ||
<div daffNotificationActions> | ||
<button daff-button size="sm">Confirm</button> | ||
<button daff-button size="sm" color="theme-contrast">Confirm</button> | ||
<button daff-flat-button size="sm" color="theme-contrast">Cancel</button> | ||
</div> | ||
</daff-notification> |
6 changes: 6 additions & 0 deletions
6
...design/notification/examples/src/default-notification/default-notification.component.scss
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 16px; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...otification/examples/src/dismissible-notification/dismissible-notification.component.html
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
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
14 changes: 14 additions & 0 deletions
14
...ification/examples/src/notification-with-actions/notification-with-actions.component.html
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<button daff-button (click)="toggleNotification()"> | ||
<ng-container *ngIf="showNotification">Show Notification</ng-container> | ||
<ng-container *ngIf="!showNotification">Hide Notification</ng-container> | ||
</button> | ||
|
||
<daff-notification status="error" *ngIf="showNotification"> | ||
<fa-icon daffPrefix [icon]="faExclamationCircle"></fa-icon> | ||
<div daffNotificationTitle>Title</div> | ||
<div daffNotificationSubtitle>This is the subtitle with information</div> | ||
<div daffNotificationActions> | ||
<button daff-button size="sm" color="theme-contrast">Confirm</button> | ||
<button daff-flat-button size="sm" color="theme-contrast">Cancel</button> | ||
</div> | ||
</daff-notification> |
29 changes: 29 additions & 0 deletions
29
...otification/examples/src/notification-with-actions/notification-with-actions.component.ts
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
} from '@angular/core'; | ||
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'; | ||
|
||
@Component({ | ||
// eslint-disable-next-line @angular-eslint/component-selector | ||
selector: 'notification-with-actions', | ||
templateUrl: './notification-with-actions.component.html', | ||
styles: [` | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 16px; | ||
} | ||
`], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class NotificationWithActionsComponent { | ||
faExclamationCircle = faExclamationCircle; | ||
|
||
showNotification = false; | ||
|
||
toggleNotification() { | ||
this.showNotification = !this.showNotification; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...n/notification/examples/src/notification-with-actions/notification-with-actions.module.ts
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; | ||
|
||
import { DaffButtonModule } from '@daffodil/design/button'; | ||
import { DaffNotificationModule } from '@daffodil/design/notification'; | ||
|
||
import { NotificationWithActionsComponent } from './notification-with-actions.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
NotificationWithActionsComponent, | ||
], | ||
imports: [ | ||
CommonModule, | ||
DaffNotificationModule, | ||
FontAwesomeModule, | ||
DaffButtonModule, | ||
], | ||
exports: [ | ||
NotificationWithActionsComponent, | ||
], | ||
}) | ||
export class NotificationWithActionsModule { } |
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
6 changes: 4 additions & 2 deletions
6
libs/design/notification/src/notification/notification.component.html
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.