From fcd388e888d9675ea0aa24ceb5a6f811e82bfe1a Mon Sep 17 00:00:00 2001 From: Jaclyn Touchstone <95641831+jtouchstonebw@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:25:55 -0500 Subject: [PATCH] Create banner.stories.mdx (#3695) * Create banner.stories.mdx Added documentation for Banner component in Common * Update banner.stories.mdx Added comment to test verification * Update banner.stories.mdx Removing test comment * Trying our referencing stories in banner mdx * fix: build errors * Added stories for banner info, warning, danger * Formatting update libs/components/src/banner/banner.stories.ts Co-authored-by: Oscar Hinton * Update banner.stories.mdx Added list formatting to text for readability, added section for Accessibility * Update libs/components/src/stories/banner.stories.mdx Co-authored-by: Andreas Coroiu * Update libs/components/src/stories/banner.stories.mdx Co-authored-by: Andreas Coroiu * Updated banner.stories.mdx Added section for Accessibility, improvements to text formatting for readability Co-authored-by: Andreas Coroiu Co-authored-by: Oscar Hinton Co-authored-by: Andreas Coroiu --- libs/components/src/banner/banner.stories.ts | 5 +- .../components/src/stories/banner.stories.mdx | 49 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 libs/components/src/stories/banner.stories.mdx diff --git a/libs/components/src/banner/banner.stories.ts b/libs/components/src/banner/banner.stories.ts index 693731e372b..19421da9768 100644 --- a/libs/components/src/banner/banner.stories.ts +++ b/libs/components/src/banner/banner.stories.ts @@ -37,7 +37,10 @@ export default { const Template: Story = (args: BannerComponent) => ({ props: args, template: ` - Content Really Long Text Lorem Ipsum Ipsum Ipsum + + Content Really Long Text Lorem Ipsum Ipsum Ipsum + + `, }); diff --git a/libs/components/src/stories/banner.stories.mdx b/libs/components/src/stories/banner.stories.mdx new file mode 100644 index 00000000000..98e14ef0473 --- /dev/null +++ b/libs/components/src/stories/banner.stories.mdx @@ -0,0 +1,49 @@ +import { Meta, Story } from "@storybook/addon-docs"; + + + +# Banner + +Banners are used for important communication with the user that needs to be seen right away, but has little effect on the experience. Banners appear at the top of the user's screen on page load and persist across all pages a user navigates to. + +- They should always be dismissable and never use a timeout. If a user dismisses a banner, it should not reappear during that same active session. + +- Use banners sparingly, as they can feel intrusive to the user if they appear unexpectedly. Their effectiveness may decrease if too many are used. + +- Avoid stacking multiple banners. + +- Banners support a button link (text button). + +## Types + +Icons should remain consistent across these types. Do not change the icon without consulting designers. + +Use the following guidelines to help choose the correct type of banner. + +### Premium + + + +Used primarily to encourage user to upgrade to premium. + +### Info + + + +Used to communicate release notes, server maintenance or other informative event. + +### Warning + + + +Used to alert the user of outdated info or versions. + +### Danger + + + +Rarely used, but may be used to alert users over critical messages or very outdated versions. + +## Accessibility + +Include `role="status" aria-live="polite"` attributes to ensure screen readers announce the content prior to the test of the page.