-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
92 additions
and
95 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default class WebUIMakeNotification extends HTMLElement { | ||
private btnClose: HTMLButtonElement | null; | ||
|
||
constructor() { | ||
super(); | ||
this.btnClose = this.querySelector('[data-close]'); | ||
this.btnClose?.addEventListener('click', this); | ||
} | ||
|
||
// Handle web component events from constructor(). | ||
handleEvent() { | ||
this.setAttribute('hidden', ''); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@use 'webui-disclosure'; | ||
@use 'webui-make-clickable'; | ||
@use 'webui-modal'; | ||
@use 'webui-notification'; | ||
@use 'webui-share'; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
import { Meta } from '@storybook/blocks'; | ||
|
||
<Meta title="Components/Notification" /> | ||
|
||
# Notification | ||
- See the [`<webui-notification>`](/docs/web-components-or-custom-elements-webui-notification--docs) custom element. |
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
13 changes: 13 additions & 0 deletions
13
...es/6. Web Components Or Custom Elements/WebUINotification/WebUINotification.mdx
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,13 @@ | ||
import { Meta, Canvas, Controls } from '@storybook/blocks'; | ||
import * as WebUINotification from './WebUINotification.stories'; | ||
|
||
<Meta of={WebUINotification} /> | ||
|
||
# `<webui-notification>` | ||
|
||
## Accessibility considerations | ||
- Error notifications have an ARIA `role="error"`. | ||
- Other notifications have an ARIA `role="status"`. | ||
|
||
<Canvas of={WebUINotification.WebUINotification} /> | ||
<Controls of={WebUINotification.WebUINotification} /> |
24 changes: 24 additions & 0 deletions
24
...ories/6. Web Components Or Custom Elements/WebUINotification/WebUINotification.stories.js
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 { WebUINotificationHtml } from './WebUINotification'; | ||
|
||
export default { | ||
title: 'Web Components Or Custom Elements/<webui-notification>', | ||
parameters: { | ||
status: { | ||
type: 'stable', | ||
}, | ||
}, | ||
argTypes: { | ||
notificationType: { | ||
control: 'select', | ||
options: ['success', 'warning', 'error'], | ||
}, | ||
hasCloseButton: { | ||
control: 'boolean', | ||
}, | ||
}, | ||
}; | ||
|
||
export const WebUINotification = { | ||
render: (args) => WebUINotificationHtml(args), | ||
}; | ||
WebUINotification.storyName = '<webui-notification>'; |