-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(alert-banner): add alert banner component #4266
base: main
Are you sure you want to change the base?
Conversation
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
Tachometer resultsChromeaction-bar permalinkbasic-test
action-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
Firefoxaction-bar permalinkbasic-test
action-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start!! Few stories and tests are missing which would be a great addition to the element.
1da7740
to
8b83f2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make sure that you also include memory tests like this
https://github.com/adobe/spectrum-web-components/blob/main/packages/alert-dialog/test/alert-dialog-memory.test.ts
@@ -0,0 +1,97 @@ | |||
## Description | |||
|
|||
The `sp-alert-banner` shows pressing and high-signal messages, such as system alerts. It is meant to be noticed and prompt users to take action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `sp-alert-banner` shows pressing and high-signal messages, such as system alerts. It is meant to be noticed and prompt users to take action. | |
The `<sp-alert-banner>` shows pressing and high-signal messages, such as system alerts. It is meant to be noticed and prompt users to take action. |
|
||
The component dispatches a `close` event to announce that the alert banner has been closed. This can be prevented by using the `event.preventDefault()` API. | ||
|
||
## Accesibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Accesibility | |
## Accessibility |
switch (variant) { | ||
case 'info': | ||
return html` | ||
<sp-icon-info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not customisable?
|
||
expect(el.open).to.be.false; | ||
}); | ||
it('can be dismissed using public close method', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('can be dismissed using public close method', async () => { | |
it('can be dismissed using close button', async () => { |
|
||
expect(el.open).to.be.false; | ||
}); | ||
it('consumers can prevent close', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('consumers can prevent close', async () => { | |
it('prevent close', async () => { |
var(--spectrum-tabs-focus-indicator-gap) | ||
) * -1 | ||
); | ||
var( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be a part of this PR. Can you make sure this PR is clean with only related files
Description
Create alert-banner component
Related issue(s)
Motivation and context
How has this been tested?
You can check out the component at alert-banner storybook
Check out usage information on alert-banner docs site
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.