Skip to content
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

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

loredanaspataru
Copy link

@loredanaspataru loredanaspataru commented Apr 12, 2024

Description

Create alert-banner component

Related issue(s)

Motivation and context

How has this been tested?

Screenshots (if appropriate)

Screenshot 2024-04-19 at 14 27 30 Screenshot 2024-05-23 at 11 02 46 Screenshot 2024-05-23 at 11 03 12

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

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.

Copy link

github-actions bot commented Apr 12, 2024

Branch preview

Visual regression test results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Copy link

github-actions bot commented Apr 15, 2024

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.99 0.95 0.99
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
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 main ("Main"). Higher scores are better, but note that the SEO scores on Netlify URLs are artifically constrained to 0.92.

Transfer Size

Category Latest Main Branch
Total 220.837 kB 210.238 kB 🏆 210.491 kB
Scripts 53.295 kB 48.065 kB 🏆 48.186 kB
Stylesheet 34.792 kB 30.291 kB 🏆 30.40 kB
Document 5.987 kB 5.285 kB 🏆 5.289 kB
Font 126.763 kB 126.597 kB 🏆 126.616 kB

Request Count

Category Latest Main Branch
Total 45 45 45
Scripts 37 37 37
Stylesheet 5 5 5
Document 1 1 1
Font 2 2 2

Copy link

github-actions bot commented Apr 15, 2024

Tachometer results

Chrome

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 484 kB 49.42ms - 51.31ms - faster ✔
2% - 8%
1.19ms - 4.07ms
branch 472 kB 51.91ms - 54.08ms slower ❌
2% - 8%
1.19ms - 4.07ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 647 kB 130.26ms - 133.16ms - faster ✔
6% - 9%
7.93ms - 12.21ms
branch 634 kB 140.21ms - 143.36ms slower ❌
6% - 9%
7.93ms - 12.21ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 604 kB 59.98ms - 60.89ms - faster ✔
6% - 9%
4.08ms - 5.66ms
branch 592 kB 64.66ms - 65.95ms slower ❌
7% - 9%
4.08ms - 5.66ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 603 kB 58.31ms - 59.25ms - faster ✔
5% - 8%
3.42ms - 5.12ms
branch 591 kB 62.34ms - 63.76ms slower ❌
6% - 9%
3.42ms - 5.12ms
-

test-open-close-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 790 kB 1871.04ms - 1874.06ms - unsure 🔍
-0% - +0%
-3.23ms - +1.23ms
branch 777 kB 1871.92ms - 1875.19ms unsure 🔍
-0% - +0%
-1.23ms - +3.23ms
-

test-open-close permalink

Version Bytes Avg Time vs remote vs branch
npm latest 788 kB 1858.44ms - 1861.13ms - unsure 🔍
-0% - +0%
-1.20ms - +2.42ms
branch 776 kB 1857.97ms - 1860.38ms unsure 🔍
-0% - +0%
-2.42ms - +1.20ms
-
Firefox

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 484 kB 110.49ms - 116.19ms - faster ✔
1% - 7%
1.18ms - 8.78ms
branch 472 kB 115.81ms - 120.83ms slower ❌
1% - 8%
1.18ms - 8.78ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 647 kB 272.51ms - 275.57ms - faster ✔
13% - 15%
42.80ms - 48.52ms
branch 634 kB 317.28ms - 322.12ms slower ❌
16% - 18%
42.80ms - 48.52ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 604 kB 129.00ms - 131.92ms - unsure 🔍
-2% - +0%
-2.64ms - +0.48ms
branch 592 kB 130.99ms - 132.09ms unsure 🔍
-0% - +2%
-0.48ms - +2.64ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 603 kB 155.54ms - 160.10ms - slower ❌
9% - 15%
13.13ms - 20.39ms
branch 591 kB 138.23ms - 143.89ms faster ✔
8% - 13%
13.13ms - 20.39ms
-

test-open-close-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 790 kB 1908.73ms - 1918.71ms - slower ❌
1% - 2%
20.36ms - 31.12ms
branch 777 kB 1885.97ms - 1889.99ms faster ✔
1% - 2%
20.36ms - 31.12ms
-

test-open-close permalink

Version Bytes Avg Time vs remote vs branch
npm latest 788 kB 1884.99ms - 1890.17ms - unsure 🔍
-0% - +0%
-4.13ms - +4.17ms
branch 776 kB 1884.31ms - 1890.81ms unsure 🔍
-0% - +0%
-4.17ms - +4.13ms
-

@loredanaspataru loredanaspataru marked this pull request as ready for review April 15, 2024 14:28
@Rajdeepc Rajdeepc requested a review from a team April 16, 2024 04:20
Copy link
Contributor

@Rajdeepc Rajdeepc left a 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.

packages/alert-banner/src/AlertBanner.ts Show resolved Hide resolved
packages/alert-banner/src/AlertBanner.ts Show resolved Hide resolved
packages/alert-banner/stories/alert-banner.stories.ts Outdated Show resolved Hide resolved
packages/alert-banner/test/alert-banner.test.ts Outdated Show resolved Hide resolved
@Rajdeepc Rajdeepc requested a review from a team April 19, 2024 11:00
packages/alert-banner/stories/alert-banner.stories.ts Outdated Show resolved Hide resolved
packages/alert-banner/src/AlertBanner.ts Outdated Show resolved Hide resolved
packages/alert-banner/src/AlertBanner.ts Outdated Show resolved Hide resolved
packages/alert-banner/src/AlertBanner.ts Outdated Show resolved Hide resolved
packages/alert-banner/src/AlertBanner.ts Outdated Show resolved Hide resolved
packages/alert-banner/src/AlertBanner.ts Outdated Show resolved Hide resolved
packages/alert-banner/src/alert-banner.css Outdated Show resolved Hide resolved
@adobe adobe deleted a comment from changeset-bot bot Apr 25, 2024
@Rajdeepc
Copy link
Contributor

Rajdeepc commented Apr 29, 2024

Please check the below issues by changing different device types.

Screenshot 2024-04-29 at 2 55 37 PM Screenshot 2024-04-29 at 2 55 43 PM Screenshot 2024-04-29 at 2 55 23 PM

Copy link
Contributor

@Rajdeepc Rajdeepc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Accesibility
## Accessibility

switch (variant) {
case 'info':
return html`
<sp-icon-info
Copy link
Contributor

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 () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it('consumers can prevent close', async () => {
it('prevent close', async () => {

var(--spectrum-tabs-focus-indicator-gap)
) * -1
);
var(
Copy link
Contributor

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

@Rajdeepc Rajdeepc requested a review from a team May 27, 2024 10:58
@Rajdeepc
Copy link
Contributor

Rajdeepc commented May 27, 2024

For larger text the UI is getting distorted. Can you please confirm this with design and update the necessary css changes for this! This will require a text-wrap with a flex container.

Screenshot 2024-05-27 at 4 29 04 PM

Also for documentation site, the demo is breaking.

Screenshot 2024-05-27 at 7 51 26 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants