-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for an icon in the Banner component (#2249)
## Summary: Adds support for an icon (phosphor or custom) to the Banner component. This overrides the default icon used to represent the kind of Banner Issue: WB-1447 ## Test plan: - Review Banner documentation (`?path=/docs/packages-banner--docs`) - new `icon` prop documentation - the example story descriptions for `With Phosphor Icon` and `With Custom Icon` - Verify that the Banner works with a PhosphorIcon (`?path=/story/packages-banner--with-phosphor-icon`) - Verify that the Banner works with a custom icon (`?path=/story/packages-banner--with-custom-icon`) - Verify that the aria-label of the icon matches the `kind` prop ("info", "success", "warning", "critical") - Note: I created WB-1713 since the aria label for the icon doesn't support translations at the moment ## Screenshots Banner with Phosphor Icon <img width="1728" alt="Banner with Phosphor Icon" src="https://github.com/Khan/wonder-blocks/assets/14334617/aee36007-d482-4d7a-9188-3bd1fa2b930c"> Banner with Custom Icon <img width="1727" alt="Banner with Custom Icon" src="https://github.com/Khan/wonder-blocks/assets/14334617/f430f336-84b1-41f1-8078-02d837e55c51"> Author: beaesguerra Reviewers: beaesguerra, jandrade Required Reviewers: Approved By: jandrade Checks: ✅ codecov/project, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Lint (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ gerald, ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️ Publish npm snapshot, ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ⏭️ dependabot Pull Request URL: #2249
- Loading branch information
1 parent
cc2d8e8
commit 9eecfc5
Showing
6 changed files
with
182 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/wonder-blocks-banner": minor | ||
--- | ||
|
||
Adds optional `icon` prop for the `Banner` component. An icon asset (either imported from Phosphor or a imported custom icon) can be used. If not provided, default icons are used to represent the `kind` prop. |
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
1 change: 1 addition & 0 deletions
1
packages/wonder-blocks-banner/src/components/__tests__/custom-icon-mock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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