diff --git a/packages/docs/content/components/accordion.mdx b/packages/docs/content/components/accordion.mdx index 212365ee05..bd2c221c90 100644 --- a/packages/docs/content/components/accordion.mdx +++ b/packages/docs/content/components/accordion.mdx @@ -65,16 +65,18 @@ Keyboard support for the Accordion header includes: ## Component maturity diff --git a/packages/docs/content/components/alert.mdx b/packages/docs/content/components/alert.mdx index a3e1aa665f..8a6c011d88 100644 --- a/packages/docs/content/components/alert.mdx +++ b/packages/docs/content/components/alert.mdx @@ -11,7 +11,7 @@ medicare: sketchLink: 1K9gg0y --- -import { Badge, CloseIconThin } from '@cmsgov/design-system'; +import { Accordion, Badge, CloseIconThin } from '@cmsgov/design-system'; ## Examples @@ -67,93 +67,42 @@ Informs users that their entry or selection may have unexpected or undesirable r - - -### Success - - - -Confirms the successful completion of a step or task, or receipt of information provided by the user. Suggests a path forward that may be beneficial to the user, based on their selections or entries. - - - - - -Does not require an icon. - -Confirms the successful completion of a step or task, or receipt of information provided by the user. - - - - - - - -### Note - -Not in the design system yet. - -Does not require an icon. - -Explains concepts which may include math or maybe not. - - - -### Lightweight - - - - - Unused by Medicare. - + - - - +## How it works -Used to show important but not as urgent messages as standard alerts. +### When to use - +- As a validation message that alerts someone that they just did something that needs to be corrected or as confirmation that a task was completed successfully. +- As a callout or notification for important or timely information. This includes errors, warnings, and general information. +- Drawing focus to an error or an incomplete task by prompting the user to review or take other action. +- Confirming the successful competition of a task. +- Providing key supplementary or contextual information to support the successful completion of tasks or aid overall comprehension. - +### When to consider alternatives - +- On long forms, always include in-line validation in addition to any error messages that appear at the top of the form. When possible, simplify forms by rewriting and where possible, splitting long forms across multiple pages +- If an action will result in destroying a user’s work (for example, deleting an application) use a more intrusive pattern, such as a confirmation modal dialogue, to allow the user to confirm that this is what they want. +- When you need to display content that isn't related to the user’s current goal. - +### Dos -## Guidance +- Do write the message in concise, human readable language; avoid jargon and computer code. +- Do let the user know what they need to do when they're required to do something in response to an alert and make that task as easy as possible. +- Do be mindful of other elements on the page that may compete for the user’s attention. -### Usage +### Don'ts - Don’t overdo it — too many notifications will either overwhelm or annoy the user and are likely to be ignored. -- Write the message in concise, human readable language; avoid jargon and computer code. - Don’t include notifications that aren’t related to the user’s current goal. -- When the user is required to do something in response to an alert, let them know what they need to do and make that task as easy as possible. -- Be mindful of other elements on the page that may compete for the user’s attention. - -### When to use - -- As a validation message that alerts someone that they just did something that needs to be corrected or as confirmation that a task was completed successfully. -- As a callout or notification for important or timely information. This includes errors, warnings, and general information. -- Drawing focus to an error or an incomplete task by prompting the user to review or take other action. -- Confirming the successful competition of a task. -- Providing key supplementary or contextual information to support the successful completion of tasks or aid overall comprehension. -### Don't use - -- You need to display alerts that aren’t related to the user’s current goal. +- Don't display alerts that aren’t related to the user’s current goal. -### When to consider alternatives - -- On long forms, always include in-line validation in addition to any error messages that appear at the top of the form. When possible, simplify forms by rewriting and where possible, splitting long forms across multiple pages -- If an action will result in destroying a user’s work (for example, deleting an application) use a more intrusive pattern, such as a confirmation modal dialogue, to allow the user to confirm that this is what they want. -- When you need to display content that isn't related to the user’s current goal. - -**When the alert is for an error:** +### For error alerts - Be polite in error messages — don’t place blame on the user. - Users generally won’t read documentation but will read a message that helps them resolve an error; include some educational material in your error message. @@ -277,18 +226,20 @@ When using a screen reader (NVDA, JAWS, VoiceOver, TalkBack): - Use active voice: "Access your application...". Start with an action verb whenever possible. + Do use active voice: "Access your application...". Start with an action verb whenever + possible. - Use passive voice: "Your application can be accessed by...." + Don't use passive voice: "Your application can be accessed by...". It's less clear and takes + more words to convey the same message. - Contractions + Do use contractions. - These specific contractions: "it'll, that’ll, why’s, how’s, you’d" + Don't use these specific contractions: "it'll, that’ll, why’s, how’s, you’d". @@ -296,43 +247,157 @@ When using a screen reader (NVDA, JAWS, VoiceOver, TalkBack): -## Learn more +## Examples -- [18F Content Guide \- Active voice](https://content-guide.18f.gov/active-voice/) +### Informational (Default) -## Component maturity + - - -## Code - -### React +Provides supplementary information, or highlights a tool or step available to the user, that may be helpful to users regarding their current action or task, but is optional or not critical. Can provide guidance on what the user needs to do to proceed. Provides additional information, such as definitions, explanations, or criteria, that the user may find helpful as they answer questions with unfamiliar terminology or policy considerations. - + -### Web Component + - +Does not require an icon. + +Provides supplementary information, or highlights a tool or step available to the user, that may be helpful to users regarding their current action or task, but is optional or not critical. Can provide guidance on what the user needs to do to proceed. + + + + + +### Error + + + +Informs users of an error or critical failure. Often used to block them from proceeding until they resolve the issue including system alerts. + + + + + +Requires an icon. + +Informs users of an error or critical failure. Often used to block them from proceeding until they resolve the issue including system alerts. + + + + + +### Warning + + + +Informs users that their entry or selection may have unexpected or undesirable results, some of which may not be easily undone. Highlights information a user should be aware of in order to help them avoid taking an action that is likely to result in a negative outcome or understand when content/data is missing from the page. + + + + + +Requires an icon. + +Informs users that their entry or selection may have unexpected or undesirable results, some of which may not be easily undone. + + + + + +### Success + + + +Confirms the successful completion of a step or task, or receipt of information provided by the user. Suggests a path forward that may be beneficial to the user, based on their selections or entries. + + + + + +Does not require an icon. -### Style customization +Confirms the successful completion of a step or task, or receipt of information provided by the user. -The following CSS variables can be overridden to customize Alert components: + - + -### Analytics + + +### Note + +Not in the design system yet. + +Does not require an icon. + +Explains concepts which may include math or maybe not. + + + +### Lightweight + + + + + Unused by Medicare. + + + + + + +Used to show important but not as urgent messages as standard alerts. + + + + + + + + + + + +## Component maturity + + + +## Learn more + +[18F Content Guide \- Active voice](https://content-guide.18f.gov/active-voice/) + +## Resources + +### Design + + + +### Development This component has analytics tracking available. Please see our developer documentation about [using analytics in the design system](/getting-started/for-developers/#analytics). + + + + + + + + + + diff --git a/packages/docs/content/components/autocomplete.mdx b/packages/docs/content/components/autocomplete.mdx index a007a6eec3..39d09240aa 100644 --- a/packages/docs/content/components/autocomplete.mdx +++ b/packages/docs/content/components/autocomplete.mdx @@ -72,16 +72,18 @@ The following CSS variables can be overridden to customize Autocomplete componen ## Component maturity diff --git a/packages/docs/content/components/badge.mdx b/packages/docs/content/components/badge.mdx index fad507ca7d..b1ce5e2481 100644 --- a/packages/docs/content/components/badge.mdx +++ b/packages/docs/content/components/badge.mdx @@ -80,16 +80,18 @@ The following CSS variables can be overridden to customize Badge components: ## Component maturity diff --git a/packages/docs/content/components/button.mdx b/packages/docs/content/components/button.mdx index 0cb37f83f5..af52c601d6 100644 --- a/packages/docs/content/components/button.mdx +++ b/packages/docs/content/components/button.mdx @@ -687,16 +687,18 @@ Generally better to use specific verbs if appropriate to confirm an action. ## Component maturity diff --git a/packages/docs/content/components/card.mdx b/packages/docs/content/components/card.mdx index ce8e798b46..8d28a77b40 100644 --- a/packages/docs/content/components/card.mdx +++ b/packages/docs/content/components/card.mdx @@ -29,16 +29,18 @@ import { Alert } from '@cmsgov/design-system'; ## Component maturity diff --git a/packages/docs/content/components/checkbox.mdx b/packages/docs/content/components/checkbox.mdx index adf06d276a..b24096a8dc 100644 --- a/packages/docs/content/components/checkbox.mdx +++ b/packages/docs/content/components/checkbox.mdx @@ -146,16 +146,18 @@ Read our Form Validations guidance for communicating to users about form errors ## Component maturity diff --git a/packages/docs/content/components/date-field/date-picker.mdx b/packages/docs/content/components/date-field/date-picker.mdx index f67ef1966e..c4f42ca1fb 100644 --- a/packages/docs/content/components/date-field/date-picker.mdx +++ b/packages/docs/content/components/date-field/date-picker.mdx @@ -69,16 +69,18 @@ Allow users to have flexibility in entering the date, such as allowing one-digit ## Component maturity diff --git a/packages/docs/content/components/date-field/multi-input-date-field.mdx b/packages/docs/content/components/date-field/multi-input-date-field.mdx index d1f23f784a..e6c195f6d9 100644 --- a/packages/docs/content/components/date-field/multi-input-date-field.mdx +++ b/packages/docs/content/components/date-field/multi-input-date-field.mdx @@ -68,16 +68,18 @@ Generally used for more memorable dates like date of birth, marriage date, or in ## Component maturity diff --git a/packages/docs/content/components/date-field/single-input-date-field.mdx b/packages/docs/content/components/date-field/single-input-date-field.mdx index 0ef6131c1c..692ef64490 100644 --- a/packages/docs/content/components/date-field/single-input-date-field.mdx +++ b/packages/docs/content/components/date-field/single-input-date-field.mdx @@ -67,16 +67,18 @@ Allow users to have flexibility in entering the date, such as allowing one-digit ## Component maturity diff --git a/packages/docs/content/components/drawer.mdx b/packages/docs/content/components/drawer.mdx index a58f102bb9..69318d5479 100644 --- a/packages/docs/content/components/drawer.mdx +++ b/packages/docs/content/components/drawer.mdx @@ -155,16 +155,18 @@ A focus trap should _not_ be used when it's anticipated that the user will rely ## Component maturity diff --git a/packages/docs/content/components/dropdown.mdx b/packages/docs/content/components/dropdown.mdx index 073aa01352..daff81e1ef 100644 --- a/packages/docs/content/components/dropdown.mdx +++ b/packages/docs/content/components/dropdown.mdx @@ -129,16 +129,18 @@ The following CSS variables can be overridden to customize Dropdown components: Because Dropdown is now a custom built solution using Adobe Spectrum instead of a native `