diff --git a/src/_about/contributing/contributing-to-docs.md b/src/_about/contributing/contributing-to-docs.md index c821c15ce..9bc842ed7 100644 --- a/src/_about/contributing/contributing-to-docs.md +++ b/src/_about/contributing/contributing-to-docs.md @@ -138,17 +138,10 @@ To display an image: {% endraw %} ``` -### Showing code props +### Showing links to code usage on Storybook -To show a table of code props: +Use `` to link to Storybook docs for the related component. -```markdown -{% raw %} -{% include component-docs.html component_name=page.web-component %} -{% endraw %} -``` - -Note that the header is included in the include file. ### Showing the component checklist diff --git a/src/_components/additional-info.md b/src/_components/additional-info.md index ef660bfc9..2729c021e 100644 --- a/src/_components/additional-info.md +++ b/src/_components/additional-info.md @@ -1,8 +1,8 @@ --- layout: component -title: Additional info +title: Additional Info status: use-with-caution-candidate -intro-text: "Additional info makes content easier to scan as it hides information that may not be applicable to all users or situations. Use this component to situate plain language help at the point of the process where it is most relevant." +intro-text: "Additional Info makes content easier to scan as it hides information that may not be applicable to all users or situations. Use this component to situate plain language help at the point of the process where it is most relevant." figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=203-1254 web-component: va-additional-info web: true @@ -32,14 +32,14 @@ anchors: ## Usage -### When to use Additional info +### When to use Additional Info * **Revealing helpful background information**: When you have additional information you want to convey about an application, process, or a step or question in a form that is not critical. This component should be used in instances where a more prominent [Alert]({{ site.baseurl }}/components/alert) would not be appropriate. -* **Clarifying outcomes for an input**: In cases where a person's input can have large or complicated impact on outcomes we use contextual help in Additional info to locate expanded guidance next to the relevant interaction. +* **Clarifying outcomes for an input**: In cases where a person's input can have large or complicated impact on outcomes we use contextual help in Additional Info to locate expanded guidance next to the relevant interaction. * **Information closely tied to an input.** Use this component over an [Accordion]({{ site.baseurl }}/components/accordion) when the content is closely tied to a particular message or input on the screen. If the content is more tangentially related then use an Accordion. -* **Clarifying a form question**: If a form question needs clarification, and that clarification is brief, use Additional info. The lighter design prevents breaking up the visual progression as the user navigates the form. These can also serve as alternative to where accordions feel too heavy. Be sure to review the [hint text guidance]({{ site.baseurl }}/components/form/label#hint-text) for implementation details. If a form is a conversation, Additional info would be considered an aside. (This case study on structuring complex health care questions for healthcare.gov goes into greater detail on how to structure your form as a conversation.) +* **Clarifying a form question**: If a form question needs clarification, and that clarification is brief, use Additional Info. The lighter design prevents breaking up the visual progression as the user navigates the form. These can also serve as alternative to where accordions feel too heavy. Be sure to review the [hint text guidance]({{ site.baseurl }}/components/form/label#hint-text) for implementation details. If a form is a conversation, Additional Info would be considered an aside. (This case study on structuring complex health care questions for healthcare.gov goes into greater detail on how to structure your form as a conversation.) * **Content that can be organized under the current heading.** If you have additional content that provides context and makes sense under the same heading as the content nearby. -* **Information not applicable to all**: Additional info can hide details that may not be applicable to all users. +* **Information not applicable to all**: Additional Info can hide details that may not be applicable to all users. ### When to consider something else @@ -49,7 +49,7 @@ anchors: * **Content organized under a new heading.** If you have enough content that it makes sense to organize under a new heading that does not make sense under the same heading as the content nearby then use an [Accordion]({{ site.baseurl }}/components/accordion). * **Error messages or other immediate actions**: Do not use this component for error messages or other critical or timely information. * **Inside Alerts**: Use this component inside an [Alert]({{ site.baseurl }}/components/alert) only as a last resort and if approved in the Collaboration Cycle. Instead use the [Alert - Expandable]({{ site.baseurl }}/components/alert/alert-expandable) component, especially when the Alert is within the page content and not at the top of the page. -* **Floating in space**: Try to avoid using Additional info outside of the flow of the page, unattached to a section of content or another component. For example, there are instances of Additional info between a h1 and a Card. See [placement](#placement) for more. +* **Floating in space**: Try to avoid using Additional Info outside of the flow of the page, unattached to a section of content or another component. For example, there are instances of Additional Info between a h1 and a Card. See [placement](#placement) for more. ## Behavior @@ -57,11 +57,11 @@ The help is triggered by clicking on a uniquely styled text link with a plain la ### Choosing between variations -Choose the [No border](#no-border) variation when using Additional info inside of a bordered container as the border would be duplicative and unnecessary. Note however that the most common occurrence of this is using this component inside an Alert which is strongly discouraged. Consider instead linking to another page, especially if your content is long or complex, or reducing content. +Choose the [No border](#no-border) variation when using Additional Info inside of a bordered container as the border would be duplicative and unnecessary. Note however that the most common occurrence of this is using this component inside an Alert which is strongly discouraged. Consider instead linking to another page, especially if your content is long or complex, or reducing content. ### Placement -The following are places where Additional info can be used: +The following are places where Additional Info can be used: * After a header (h2, h3, h4) or paragraph to provide orthogonal details or provide an answer to a common question. * Within a [Process list]({{ site.baseurl }}/components/process-list) to shorten the length of content within a step. @@ -79,7 +79,7 @@ The following are places where Additional info can be used: ## Content considerations * **Use a statement, rather than a question.** Use a statement (like “Why we ask for this information”) rather than a question (like “Why does VA ask for this information?”) for the title (trigger text) of the component. Because we use questions to gather information from people in our forms, structuring additional information as questions as well can cause confusion. Keep titles to a single sentence or sentence fragment with no ending punctuation. -* **Limit the amount of expanded content.** Limit content to fewer than 500 characters (with spaces) when possible. If you need to provide more information, consider using one or more [Accordions]({{ site.baseurl }}/components/accordion) instead or providing a brief overview in the Additional info component with a link to another page with more information. Collaborate with a member of the Content and Information Architecture team to edit content and explore alternatives. +* **Limit the amount of expanded content.** Limit content to fewer than 500 characters (with spaces) when possible. If you need to provide more information, consider using one or more [Accordions]({{ site.baseurl }}/components/accordion) instead or providing a brief overview in the Additional Info component with a link to another page with more information. Collaborate with a member of the Content and Information Architecture team to edit content and explore alternatives. * **Use lists in expanded content as needed.** To make content easier to scan, we encourage you to use numbered (also called "ordered") and bulleted (also called "unordered") lists as needed. ## Accessibility considerations diff --git a/src/_components/address-block.md b/src/_components/address-block.md index 3d6799221..7f7ebdd97 100644 --- a/src/_components/address-block.md +++ b/src/_components/address-block.md @@ -1,7 +1,7 @@ --- layout: component -title: Address block -intro-text: "Address block is used to highlight mailing and physical addresses and contact information for VA facilities (with some notable exceptions). It can also be used to display personal information we may have for a Veteran." +title: Address Block +intro-text: "Address Block is used to highlight mailing and physical addresses and contact information for VA facilities (with some notable exceptions). It can also be used to display personal information we may have for a Veteran." github-title: va-address-block figma-link-web: https://www.figma.com/file/JDFpGLIojfuQwANXScQjqe/VADS-Component-Example-Library?type=design&node-id=1102%3A9228&mode=design&t=J32RmU6Fjbjuh9bD-1 status: use-best-practice @@ -34,7 +34,7 @@ anchors: ### Placement -* Address block can appear within a block of content following a paragraph, list, or header. +* Address Block can appear within a block of content following a paragraph, list, or header. ### Instances of this component in production @@ -54,7 +54,7 @@ anchors: ## Code usage -* The Address block component is created by applying the CSS class .va-address-block to a

HTML element. +* The Address Block component is created by applying the CSS class .va-address-block to a

HTML element. * Only use the

HTML element for contact information related to the current page.
is only intended for contact information and not physical addresses (e.g. not for a Health Center facility address). @@ -62,4 +62,4 @@ anchors: {% include content/addresses.md %} -{% include _component-checklist.html component_name="va-address-block" %} \ No newline at end of file +{% include _component-checklist.html component_name="va-address-block" %} diff --git a/src/_components/back-to-top.md b/src/_components/back-to-top.md index 869ad5cfb..85e689641 100644 --- a/src/_components/back-to-top.md +++ b/src/_components/back-to-top.md @@ -1,16 +1,16 @@ --- layout: component -sub_section: Back to top -title: "Back to top" +sub_section: Back to Top +title: "Back to Top" figma-link-web: https://www.figma.com/file/JDFpGLIojfuQwANXScQjqe/VADS-Component-Example-Library?type=design&node-id=1110%3A4128&mode=design&t=vNilCSI60pQBiKkM-1 -intro-text: "The Back to top component is a shortcut that allows the user to quickly navigate to the top of a long page of content." +intro-text: "The Back to Top component is a shortcut that allows the user to quickly navigate to the top of a long page of content." web-component: va-back-to-top web: true mobile-app: false anchors: - anchor: Examples - anchor: Usage - - anchor: Code usage + - anchor: Code Usage - anchor: Accessibility considerations --- @@ -22,7 +22,7 @@ anchors: ## Usage -* On large and medium screens, the Back to top component will have the label, “Back to top” with an arrow icon to the left of the label. On small screens, the Back to top component will only have the arrow icon. Use one Back to top component per page. +* On large and medium screens, the Back to Top component will have the label, “Back to Top” with an arrow icon to the left of the label. On small screens, the Back to top component will only have the arrow icon. Use one Back to top component per page. ### When to use Back to top diff --git a/src/_components/banner/index.md b/src/_components/banner/index.md index 4890516ac..3e1d300f1 100644 --- a/src/_components/banner/index.md +++ b/src/_components/banner/index.md @@ -78,4 +78,4 @@ anchors: ## Content considerations * **Short and informative headlines.** Try to keep headlines to 70 characters maximum, with spaces. Titles become hard to scan when they’re too long. Eliminate unnecessary details or nuance in titles, and address them with more depth in the message copy. -* **Short messages with links for greater detail.** Try to keep message copy to 300 characters maximum, with spaces. When more detail is needed, link to another page that has all of the details. Pages that can be linked to might include Operating status or News releases. \ No newline at end of file +* **Short messages with links for greater detail.** Try to keep message copy to 300 characters maximum, with spaces. When more detail is needed, link to another page that has all of the details. Pages that can be linked to might include Operating status or News releases. diff --git a/src/_components/banner/maintenance.md b/src/_components/banner/maintenance.md index d18da8c41..ffebbff52 100644 --- a/src/_components/banner/maintenance.md +++ b/src/_components/banner/maintenance.md @@ -50,4 +50,4 @@ The Public Website Team (Office of the CTO Digital Experience) publishes downtim * The banner automatically expires when downtime is complete. * A maximum of 3 banners can appear simultaneously. -{% include component-docs.html component_name=page.web-component %} \ No newline at end of file +{% include component-docs.html component_name=page.web-component %} diff --git a/src/_components/banner/official-gov.md b/src/_components/banner/official-gov.md index fa7c69dc2..60cefb241 100644 --- a/src/_components/banner/official-gov.md +++ b/src/_components/banner/official-gov.md @@ -31,11 +31,13 @@ anchors:

USWDS component

This component comes directly from the U.S. Web Design System (USWDS). Thus we follow the guidance and considerations documented in the USWDS for this component. The guidance below augments the USWDS guidance to give specifics on how we use the component at the VA.

- +

+ +

### When to use Banner - Official Gov diff --git a/src/_components/button/button-group.md b/src/_components/button/button-group.md index 8cedcd767..09dc4de83 100644 --- a/src/_components/button/button-group.md +++ b/src/_components/button/button-group.md @@ -2,11 +2,11 @@ layout: component permalink: /components/button/button-group has-parent: /components/button/ -title: Button group -aka: Button pair +title: Button Group +aka: Button Pair research-link: Buttons figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=601-5424 -intro-text: The default button group arranges each button as a separate element with a gap between them. On mobile devices, the buttons are arranged vertically. +intro-text: The default Button Group arranges each button as a separate element with a gap between them. On mobile devices, the buttons are arranged vertically. status: use-deployed web-component: va-button-pair web: true @@ -39,7 +39,7 @@ anchors: @@ -62,20 +62,20 @@ type="secondary" - Buttons appear full width up to the [mobile-lg breakpoint]({{ site.baseurl }}/foundation/breakpoints#names-and-values), with the primary button on top of the secondary button. - At and above the [mobile-lg breakpoint]({{ site.baseurl }}/foundation/breakpoints#names-and-values), buttons left-align and revert to their natural width (i.e., as wide as they need to be to accommodate their label). The primary button continues to appear before the secondary button. -### Button groups in modals +### Button Groups in modals - Button groups within [default modals]({{ site.baseurl }}/components/modal/#default) always stack vertically at full width, regardless of breakpoint size. - Button groups within [**large** modals]({{ site.baseurl }}/components/modal/#large) stack vertically at full width until the [tablet breakpoint]({{ site.baseurl }}/foundation/breakpoints#names-and-values). Above that breakpoint, buttons revert to their natural width and appear inline, with the primary button before the secondary button. ### Choosing between variations -- Use the [default](#default-yesno) button group variation to provide primary and secondary response options to a question. -- Use the [Update/Cancel](#updatecancel) button group variation for saving form input on a form. -- Use the [Back/Continue](#backcontinue) button group variation for providing navigation options through a step by step flow of form pages. +- Use the [default](#default-yesno) Button Group variation to provide primary and secondary response options to a question. +- Use the [Update/Cancel](#updatecancel) Button Group variation for saving form input on a form. +- Use the [Back/Continue](#backcontinue) Button Group variation for providing navigation options through a step by step flow of form pages. ### Placement -- A button group appears at the bottom of a form. +- A Button Group appears at the bottom of a form. ### Design principles diff --git a/src/_components/button/button-segmented.md b/src/_components/button/button-segmented.md index 790822abb..035840240 100644 --- a/src/_components/button/button-segmented.md +++ b/src/_components/button/button-segmented.md @@ -114,7 +114,7 @@ The component is often integrated into the top navigation bar (or just below it) * **Claims:** Using a control to switch between "Status" and "Details." This groups dissimilar content and should be handled with a different component, like [Tabs]({{ site.baseurl }}/components/tabs). -{% include component-docs.html component_name=page.web-component %} +{% include component-docs.html component_name=page.web-component mobile_component_name="va-segmented-control" %} ## Content considerations diff --git a/src/_components/form/combo-box.md b/src/_components/form/combo-box.md index a9fea6851..e8d08a235 100644 --- a/src/_components/form/combo-box.md +++ b/src/_components/form/combo-box.md @@ -2,7 +2,7 @@ layout: component permalink: /components/form/combo-box has-parent: /components/form/ -title: Combo box +title: Combo Box intro-text: "A combo box helps users select an item from a large list of options." research-title: Form controls status: use-with-caution-candidate diff --git a/src/_components/form/date-input.md b/src/_components/form/date-input.md index 8f4dc9408..c95a47d64 100644 --- a/src/_components/form/date-input.md +++ b/src/_components/form/date-input.md @@ -2,10 +2,10 @@ layout: component permalink: /components/form/date-input has-parent: /components/form/ -title: Date input +title: Date Input research-title: Form controls figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=2000-2564 -intro-text: "Use the date input component to help users enter a date they would know or a date they can approximate." +intro-text: "Use the Date Input component to help users enter a date they would know or a date they can approximate." status: use-deployed anchors: - anchor: Examples @@ -43,14 +43,14 @@ mobile-app: false ## Usage -### When to use date input +### When to use Date Input - Use a month, day, year date input component for a date a user knows, like a date of birth or marriage. (Example: July 21, 1992). Or a date they can easily look up (for example, the expiration date of a credit card). - Use the [month year](#monthyear) variant for a date a user can approximate, like a date they graduated from high school or a GED equivalent. (Example: May 2010) ### When to consider something else -Do not use the date input component if users are unlikely to know the exact date of the event you’re asking about. You may consider using a date picker for scheduling, with the following caveats +Do not use the Date Input component if users are unlikely to know the exact date of the event you’re asking about. You may consider using a date picker for scheduling, with the following caveats - We do not currently have a calendar picker as part of the design system. For reference, visit the VA online scheduling tool (VAOS) to see an experimental version of a calendar picker. - Date pickers have not been tested for accessibility, and may lead to launch blocking issues for your product unless carefully designed with an accessibility specialist. We strongly recommend reaching out to #accessibility-help on slack for support before considering this pattern. @@ -61,7 +61,7 @@ Do not use the date input component if users are unlikely to know the exact date - For the month select box, provide the user unabbreviated months to choose from. Example: January ### Validation -By default all date components have the following validation: +By default all Date components have the following validation: - Cannot have blank values - Month and Day must be valid numbers - The Year cannot fall outside of the range of 1900 through the current year plus 100 years @@ -73,4 +73,4 @@ The option to add [custom validation](#with-custom-validation) is available as w ## Accessibility considerations -Follow text input and select box guidance. The component consists of two select boxes for month and day inputs and a text input for year input. \ No newline at end of file +Follow text input and select box guidance. The component consists of two select boxes for month and day inputs and a text input for year input. diff --git a/src/_components/form/file-input.md b/src/_components/form/file-input.md index 661335b24..092abfe56 100644 --- a/src/_components/form/file-input.md +++ b/src/_components/form/file-input.md @@ -4,8 +4,8 @@ permalink: /components/form/file-input redirect_from: - /components/form/file-input-multiple has-parent: /components/form/ -title: File input -intro-text: "File input allows files to be attached and/or uploaded. Use the single file variation for one file at a time, or the multiple file variation to include several files in sequence." +title: File Input +intro-text: "File Input allows files to be attached and/or uploaded. Use the single file variation for one file at a time, or the multiple file variation to include several files in sequence." research-title: Form controls figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=199-1212 github-discussion-url: https://github.com/department-of-veterans-affairs/vets-design-system-documentation/discussions/4609 @@ -25,10 +25,10 @@ anchors: ## Overview -The file input component gives users a way to select and upload files. You have two options: +The File Input component gives users a way to select and upload files. You have two options: -* **Single file input** – Use when users need to upload one file at a time. -* **Multiple file input** – Use when users need to upload several files in sequence. +* **Single File Input** – Use when users need to upload one file at a time. +* **Multiple File Input** – Use when users need to upload several files in sequence. ## Examples @@ -79,7 +79,7 @@ The file input component gives users a way to select and upload files. You have #### File uploading with progress indicator An API must populate percentUploaded with a value to display the progress bar. -{% include component-example.html alt="File input component showing a progress bar at 50% while uploading a document" file="/images/components/file-input/file-input-uploading.png" caption="File input showing upload progress. (Screenshot)" class="x2" reverse="true" %} +{% include component-example.html alt="File Input component showing a progress bar at 50% while uploading a document" file="/images/components/file-input/file-input-uploading.png" caption="File Input showing upload progress. (Screenshot)" class="x2" reverse="true" %} @@ -101,7 +101,7 @@ The file input component gives users a way to select and upload files. You have #### File with an additional form input -{% include component-example.html alt="Additional form inputs" file="/images/components/file-input/additionalForm.png" caption="File input used with additional form field to complete the upload process. (Screenshot)" class="x2" reverse="true" %} +{% include component-example.html alt="Additional form inputs" file="/images/components/file-input/additionalForm.png" caption="File Input used with additional form field to complete the upload process. (Screenshot)" class="x2" reverse="true" %} @@ -115,19 +115,19 @@ The file input component gives users a way to select and upload files. You have Logic for detecting and decrypting PDF files is handled in a shared Platform utility. View Checking if an uploaded PDF is encrypted. -{% include component-example.html alt="File input password prompt" file="/images/components/file-input/file-input-password-prompt.png" caption="User prompted to enter password for encrypted PDF file. (Screenshot)" class="x2" reverse="true" %} +{% include component-example.html alt="File Input password prompt" file="/images/components/file-input/file-input-password-prompt.png" caption="User prompted to enter password for encrypted PDF file. (Screenshot)" class="x2" reverse="true" %} #### Password error -{% include component-example.html alt="File input field error" file="/images/components/file-input/file-input-password-error.png" caption="Error message shown when password is incorrect. (Screenshot)" class="x2" reverse="true" %} +{% include component-example.html alt="File Input field error" file="/images/components/file-input/file-input-password-error.png" caption="Error message shown when password is incorrect. (Screenshot)" class="x2" reverse="true" %} #### Password success -{% include component-example.html alt="File input password success" file="/images/components/file-input/file-input-password-success.png" caption="Confirmation shown when password-protected PDF is successfully decrypted. (Screenshot)" class="x2" reverse="true" %} +{% include component-example.html alt="File Input password success" file="/images/components/file-input/file-input-password-success.png" caption="Confirmation shown when password-protected PDF is successfully decrypted. (Screenshot)" class="x2" reverse="true" %} @@ -152,7 +152,7 @@ The file input component gives users a way to select and upload files. You have ### How file inputs work at VA -**Upload one file at a time.** The file input component uploads a single file per interaction. People cannot select multiple files at once because: +**Upload one file at a time.** The File Input component uploads a single file per interaction. People cannot select multiple files at once because: * Not everyone knows how to select multiple files in their OS file browser * Some mobile devices do not support selecting multiple files at once diff --git a/src/_components/form/index.md b/src/_components/form/index.md index a26a8a934..424da12f7 100644 --- a/src/_components/form/index.md +++ b/src/_components/form/index.md @@ -8,21 +8,21 @@ status: use-deployed sub-pages: - sub-page: Autosave - sub-page: Checkbox - - sub-page: Combo box - - sub-page: Date input - - sub-page: Memorable date - - sub-page: File input + - sub-page: Combo Box + - sub-page: Date Input + - sub-page: Memorable Date + - sub-page: File Input - sub-page: Label - - sub-page: Need help? - - sub-page: Penalty notice + - sub-page: Need Help? + - sub-page: Penalty Notice - sub-page: Prefill - sub-page: Privacy Agreement - sub-page: Progress bar - Segmented - - sub-page: Radio button + - sub-page: Radio Button - sub-page: Select - - sub-page: Statement of truth + - sub-page: Statement of Truth - sub-page: Telephone Input - - sub-page: Text input + - sub-page: Text Input - sub-page: Textarea anchors: - anchor: Usage @@ -66,4 +66,4 @@ anchors: ## Hint text -{% include components/hint-text.md %} \ No newline at end of file +{% include components/hint-text.md %} diff --git a/src/_components/form/memorable-date.md b/src/_components/form/memorable-date.md index 4c0b748de..aa658761a 100644 --- a/src/_components/form/memorable-date.md +++ b/src/_components/form/memorable-date.md @@ -2,7 +2,7 @@ layout: component permalink: /components/form/memorable-date has-parent: /components/form/ -title: Memorable date +title: Memorable Date research-title: Memorable Date intro-text: "Three text fields are the easiest way for users to enter most dates." status: use-deployed @@ -107,4 +107,4 @@ anchors: type="secondary" > -{% include _component-checklist.html component_name=page.web-component %} \ No newline at end of file +{% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/form/need-help.md b/src/_components/form/need-help.md index 5ecdb3842..1c0738ac1 100644 --- a/src/_components/form/need-help.md +++ b/src/_components/form/need-help.md @@ -2,7 +2,7 @@ layout: component permalink: /components/form/need-help has-parent: /components/form/ -title: Need help? +title: Need Help? intro-text: A footer found on application pages that provides contact information for the VA. research-title: Form controls figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=199-1214 @@ -39,10 +39,8 @@ anchors: * This component appears at the bottom of the page, just before the standard VA footer. -## Code usage - -Code for this component is shown in Storybook. Follow the link provided in [examples](#examples). +{% include component-docs.html component_name=page.web-component %} ## Content considerations -* Content can vary by form and should be discussed with the content team before deploying your application. \ No newline at end of file +* Content can vary by form and should be discussed with the content team before deploying your application. diff --git a/src/_components/form/penalty-notice.md b/src/_components/form/penalty-notice.md index 7ce797baa..a21166bd5 100644 --- a/src/_components/form/penalty-notice.md +++ b/src/_components/form/penalty-notice.md @@ -2,7 +2,7 @@ layout: component permalink: /components/form/penalty-notice has-parent: /components/form/ -title: Penalty notice +title: Penalty Notice intro-text: A required legal notice for all forms. research-title: Form controls figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=199-1216 @@ -46,4 +46,4 @@ Code for this component is shown in the [examples](#examples). ## Content considerations -* Do not alter this content without legal review. \ No newline at end of file +* Do not alter this content without legal review. diff --git a/src/_components/form/prefill.md b/src/_components/form/prefill.md index b0005492b..41dc05b2d 100644 --- a/src/_components/form/prefill.md +++ b/src/_components/form/prefill.md @@ -13,8 +13,6 @@ mobile-app: false anchors: - anchor: Examples - anchor: Usage - - anchor: How to use - - anchor: Code usage - anchor: Content considerations --- @@ -44,10 +42,7 @@ anchors: * This component appears after the subtitle of the form and before the action link to start the form process on the authenticated variation of the [Form - Introduction]({{ site.baseurl }}/templates/forms/introduction#authenticated) page. -## Code usage - -Code for both variations of this component is shown in the [examples](#examples). ## Content considerations -Message content for both variations can be found in [engagement messages]({{ site.baseurl }}/content-style-guide/error-messages/engagement). \ No newline at end of file +Message content for both variations can be found in [engagement messages]({{ site.baseurl }}/content-style-guide/error-messages/engagement). diff --git a/src/_components/form/privacy-agreement.md b/src/_components/form/privacy-agreement.md index c19ed57ad..b6ef4430b 100644 --- a/src/_components/form/privacy-agreement.md +++ b/src/_components/form/privacy-agreement.md @@ -63,4 +63,4 @@ This component appears at the bottom of a form, above the link to "Finish this a **Privacy policy opens in new tab or window.** This component must detail to all users that the privacy policy link opens in a new window. This indication should be visible and auditory. -{% include _component-checklist.html component_name=page.web-component %} \ No newline at end of file +{% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/form/progress-bar-segmented.md b/src/_components/form/progress-bar-segmented.md index bfdb39c07..039b870cc 100644 --- a/src/_components/form/progress-bar-segmented.md +++ b/src/_components/form/progress-bar-segmented.md @@ -2,7 +2,7 @@ layout: component permalink: /components/form/progress-bar-segmented has-parent: /components/form/ -title: "Progress bar - Segmented" +title: "Progress Bar - Segmented" intro-text: "A segmented progress bar updates users on their progress through a multi-step process." aka: Step indicator research-title: Progress bars @@ -62,7 +62,7 @@ anchors: ### Additional guidance for VA -The segmented progress bar is primarily used in multi-step form flows to show users their progress through the application process. +The Segmented Progress Bar is primarily used in multi-step form flows to show users their progress through the application process. For additional guidance on using progress bars in form flows, see [Form templates]({{ site.baseurl }}/templates/forms/) and [Form accessibility guidelines]({{ site.baseurl }}/templates/forms/accessibility-guidelines). @@ -89,4 +89,4 @@ For additional guidance on using progress bars in form flows, see [Form template ## Related * [Activity progress bar]({{ site.baseurl }}/components/progress-bar) -* [Process list]({{ site.baseurl }}/components/process-list) \ No newline at end of file +* [Process list]({{ site.baseurl }}/components/process-list) diff --git a/src/_components/form/radio-button.md b/src/_components/form/radio-button.md index 5f06c0705..ef6bd9623 100644 --- a/src/_components/form/radio-button.md +++ b/src/_components/form/radio-button.md @@ -2,7 +2,7 @@ layout: component permalink: /components/form/radio-button has-parent: /components/form/ -title: Radio button +title: Radio Button research-title: Form controls intro-text: Radio buttons allow users to select exactly one choice from a group. figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=351-2593 diff --git a/src/_components/form/statement-of-truth.md b/src/_components/form/statement-of-truth.md index 941cc1e94..ecb589a95 100644 --- a/src/_components/form/statement-of-truth.md +++ b/src/_components/form/statement-of-truth.md @@ -2,9 +2,9 @@ layout: component permalink: /components/form/statement-of-truth has-parent: /components/form/ -title: Statement of truth +title: Statement of Truth contributor: Jeana Clark, Nick Sprinkle -intro-text: "The Statement of truth allows users to certify that the information they have provided in form is correct and true to the best of their knowledge and belief." +intro-text: "The Statement of Truth allows users to certify that the information they have provided in form is correct and true to the best of their knowledge and belief." research-title: Form - Statement of truth figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=5378-3634 status: use-deployed @@ -41,7 +41,7 @@ anchors: ## Usage -### When to use Component name +### When to use Statement of Truth * **To collect a signature.**: This component collects a digital signature from the user to certify their submission. This component is used in the [Ask users for a signature]({{ site.baseurl }}/patterns/ask-users-for/signature) pattern. diff --git a/src/_components/form/telephone-input.md b/src/_components/form/telephone-input.md index db6c527c1..3fec41296 100644 --- a/src/_components/form/telephone-input.md +++ b/src/_components/form/telephone-input.md @@ -3,7 +3,7 @@ layout: component permalink: /components/form/telephone-input has-parent: /components/form/ title: Telephone Input -intro-text: "Use the telephone input component to help users enter a telephone number." +intro-text: "Use the Telephone Input component to help users enter a telephone number." figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=31366-83 web-component: va-telephone-input web: true @@ -28,7 +28,7 @@ anchors: Only ask for a phone number if you need it. -### When to use the telephone input +### When to use the Telephone Input * **Collect domestic United States and international phone numbers.** You can place more than one telephone input component on a page if you need to collect multiple numbers. Make each label unique. * **Let users enter telephone numbers in any format familiar to them.** Accept extra spaces, hyphens, brackets, and dashes. Allow country and area codes. diff --git a/src/_components/form/text-input.md b/src/_components/form/text-input.md index 83a596aa4..3257dbe2a 100644 --- a/src/_components/form/text-input.md +++ b/src/_components/form/text-input.md @@ -2,8 +2,8 @@ layout: component permalink: /components/form/text-input has-parent: /components/form/ -title: Text input -intro-text: "Text input allows people to enter any type of text unless otherwise restricted." +title: Text Input +intro-text: "Text Input allows people to enter any type of text unless otherwise restricted." research-title: Form controls figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=199-1223 status: use-best-practice diff --git a/src/_components/icon.md b/src/_components/icon.md index 4a278adf7..524680147 100644 --- a/src/_components/icon.md +++ b/src/_components/icon.md @@ -211,8 +211,6 @@ Some icons may have specific placement guidance defined here. - **Right-facing chevrons are reserved for links, but may be used on buttons that expand and collapse additional content.** In the latter case, the direction of the chevron should indicate the direction in which additional content expands and collapses, like in drawers, flyout menus, and dropdowns. - **Examples:** Nested menu items within "VA Benefits and Health Care" in the [Header]({{ site.baseurl }}/components/header/), [Additional Info]({{ site.baseurl }}/components/additional-info), and [Alert - Expandable]({{ site.baseurl }}/components/alert/alert-expandable/). -{% include component-docs.html %} - {% include component-docs.html component_name=page.web-component %} ## Accessibility considerations @@ -357,4 +355,4 @@ Avoid requesting a new icon when: renderIconTable(icons); -{% include _component-checklist.html component_name=page.web-component %} \ No newline at end of file +{% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/language-toggle.md b/src/_components/language-toggle.md index b0f71ed9d..6a03aa0e6 100644 --- a/src/_components/language-toggle.md +++ b/src/_components/language-toggle.md @@ -1,7 +1,7 @@ --- layout: component -title: Language toggle -intro-text: "The language toggle is our way of providing translated versions of select pages on va.gov." +title: Language Toggle +intro-text: "The Language Toggle is our way of providing translated versions of select pages on va.gov." github-title: va-language-toggle research-title: va-language-toggle figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=10077-912&t=hljp6A4V60A0rDms-1 @@ -22,13 +22,13 @@ anchors: ### Default -The language toggle provides a series of links that load the page in one of three languages. +The Language Toggle provides a series of links that load the page in one of three languages. -{% include storybook-preview.html story="components-va-language-toggle--default" link_text="Language toggle" %} +{% include storybook-preview.html story="components-va-language-toggle--default" link_text="Language Toggle" %} ### Two Languages -{% include storybook-preview.html story="components-va-language-toggle--two-languages" link_text="Language toggle" %} +{% include storybook-preview.html story="components-va-language-toggle--two-languages" link_text="Language Toggle" %} ## Usage @@ -43,14 +43,14 @@ The language toggle provides a series of links that load the page in one of thre ### How this component works -* **Provides navigation to the same page at a language-specific URL.** The language toggle uses links to navigate the user to the same page, in a different language, and at a language-specific URL. Currently, the language code does not match [ISO language codes](https://www.loc.gov/standards/iso639-2/php/code_list.php) but should conform in future. +* **Provides navigation to the same page at a language-specific URL.** The Language Toggle uses links to navigate the user to the same page, in a different language, and at a language-specific URL. Currently, the language code does not match [ISO language codes](https://www.loc.gov/standards/iso639-2/php/code_list.php) but should conform in future. * Example English (default) URL: [https://www.va.gov/health-care/covid-19-vaccine/](https://www.va.gov/health-care/covid-19-vaccine/) * Example Spanish URL: [https://www.va.gov/health-care/covid-19-vaccine-esp/](https://www.va.gov/health-care/covid-19-vaccine-esp/) * Example Tagalog URL: [https://www.va.gov/health-care/covid-19-vaccine-tag/](https://www.va.gov/health-care/covid-19-vaccine-tag/) ### Behavior -* **Navigates to the same page in a different language.** When selected, the language toggle brings the user to the alternate language version of the page they were on. +* **Navigates to the same page in a different language.** When selected, the Language Toggle brings the user to the alternate language version of the page they were on. * **Body content, side navigation, breadcrumbs, and any alerts are translated.** Currently (01/2024), the expectation is that the following sections of the page are translated: * Main content of the page * The parent and sibling pages within the [side navigation menu]({{ site.baseurl }}/components/sidenav) @@ -76,6 +76,8 @@ The component appears 32px below the "In this section" menu and 24px above the h * [La Ley PACT y sus beneficios de VA](https://www.va.gov/resources/the-pact-act-and-your-va-benefits-esp/) * [Ang PACT Act at ang iyong mga VA benefits](https://www.va.gov/resources/the-pact-act-and-your-va-benefits-tag/) +{% include component-docs.html component_name=page.web-component %} + ## Content considerations * **Link is in native language.** Links in this component should be in the native language. For example, "Español". **Note**: Sometimes the word is the same in both English and the target language, for example "Tagalog". @@ -83,11 +85,11 @@ The component appears 32px below the "In this section" menu and 24px above the h ## Accessibility considerations * **The language of the page should be identified using the HTML lang attribute.** For example, `
`. The `lang` attribute is also added to the `
` element. This may disagree with the lang attribute of the `` element. Please see [H58: Using language attributes to identify changes in the human language](https://www.w3.org/WAI/WCAG21/Techniques/html/H58). -* **Label the language toggle code**. This ensures that it is spoken in the correct language if read aloud by assistive technologies. The `lang` value on the link should match that of the resulting page it links to. +* **Label the Language Toggle code**. This ensures that it is spoken in the correct language if read aloud by assistive technologies. The `lang` value on the link should match that of the resulting page it links to. ## Related * [Breadcrumbs]({{ site.baseurl }}/components/breadcrumbs) * [Sidenav]({{ site.baseurl }}/components/sidenav) -{% include _component-checklist.html component_name=page.web-component %} \ No newline at end of file +{% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/link/index.md b/src/_components/link/index.md index 514d2972e..f600a4e25 100644 --- a/src/_components/link/index.md +++ b/src/_components/link/index.md @@ -324,7 +324,7 @@ The mobile app includes link variations that address platform-specific needs: * **Base link style.** The Base link style exists due to mobile app specific needs in dark mode. For example, the Alert component has a colored background for each variation. While working on dark mode, the mobile app team found that the Default link style did not meet color contrast requirements and clashed with the background colors. For this reason, a new Base style was created similar to the USWDS Base style. * **Content-specific link variants.** In Storybook, variants are available for content-specific links (add to calendar, get directions, etc.). These variants include the onPress logic for app teams, which ensures that the component always displays a native confirmation message when needed. -{% include component-docs.html component_name=page.web-component mobile_component_name="va-link" %} +{% include component-docs.html component_name=page.web-component %} ### Links to content in another language diff --git a/src/_components/loading-indicator.md b/src/_components/loading-indicator.md index e40f327b3..53e9bf45d 100644 --- a/src/_components/loading-indicator.md +++ b/src/_components/loading-indicator.md @@ -1,6 +1,6 @@ --- layout: component -title: "Loading indicator" +title: "Loading Indicator" intro-text: "A loading indicator provides a clue to ongoing activity when the site needs to load additional content." research-title: "Loading indicators" figma-link-web: https://www.figma.com/file/JDFpGLIojfuQwANXScQjqe/VADS-Component-Example-Library?type=design&node-id=35%3A161&mode=design&t=vNilCSI60pQBiKkM-1 @@ -43,7 +43,7 @@ anchors: ## Usage -### When to use the Loading indicator +### When to use the Loading Indicator * When the wait time for a process, such as loading a page, is unknown. @@ -62,11 +62,11 @@ anchors: 2. An object that is being acted upon 3. An ellipsis -* **Use present participle verbs (ending with "-ing"):** Start each loading indicator with the verb of the action that is happening. Consider what the system is actually doing. Remember that the loading indicator is supposed to inform the user what is happening while they’re waiting. The system isn’t always loading something. Sometimes it's sending something. Other times it's saving something. +* **Use present participle verbs (ending with "-ing"):** Start each Loading Indicator with the verb of the action that is happening. Consider what the system is actually doing. Remember that the Loading Indicator is supposed to inform the user what is happening while they’re waiting. The system isn’t always loading something. Sometimes it's sending something. Other times it's saving something. * **Describe the object being acted upon:** Follow the verb with the object that is being acted upon. For example, if the system is saving something, describe (in 1 or 2 words) what is being saved. If applicable, make the object personal to the user by using a possessive pronoun (your) instead of an article (a, the). -* **End with an ellipsis:** End each loading indicator with an ellipsis (3 periods). Do not use unnecessary words, such as "please" or "wait". +* **End with an ellipsis:** End each Loading Indicator with an ellipsis (3 periods). Do not use unnecessary words, such as "please" or "wait". Examples of loading indicator messages: @@ -76,5 +76,5 @@ Examples of loading indicator messages: ## Accessibility considerations -* On the web, the loading indicator component is used to notify user’s that the page content is loading. W3C WAI-ARIA `aria-live="polite"`, `aria-label` and `aria-valuetext` are used to ensure screen reader users are also provided the same information. +* On the web, the Loading Indicator component is used to notify user’s that the page content is loading. W3C WAI-ARIA `aria-live="polite"`, `aria-label` and `aria-valuetext` are used to ensure screen reader users are also provided the same information. * In the mobile app, use the equivalent accessibility hints and labels in React Native. diff --git a/src/_components/modal/crisis-line-modal.md b/src/_components/modal/crisis-line-modal.md index d59c567ca..c6399d65e 100644 --- a/src/_components/modal/crisis-line-modal.md +++ b/src/_components/modal/crisis-line-modal.md @@ -37,4 +37,4 @@ anchors: * **Do not alter the contents of this component.** The contents of this component are governed by CAIA. -{% include _component-checklist.html component_name=page.web-component %} \ No newline at end of file +{% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/modal/index.md b/src/_components/modal/index.md index 787b3fee4..7bc8dd7c4 100644 --- a/src/_components/modal/index.md +++ b/src/_components/modal/index.md @@ -91,4 +91,4 @@ anchors: href="https://designsystem.digital.gov/components/modal/#accessibility-select" text="Refer to the U.S. Web Design System for accessibility guidance" type="secondary" -> \ No newline at end of file +> diff --git a/src/_components/omb-info.md b/src/_components/omb-info.md index 1d2c58e3b..dc0fae501 100644 --- a/src/_components/omb-info.md +++ b/src/_components/omb-info.md @@ -100,6 +100,8 @@ The respondent burden estimate should be included when available, however it is As mentioned above, the Paperwork Reduction Act is very specific about the placement of this information thus it must appear on the [form introduction page]({{ site.baseurl }}/templates/forms/introduction). +{% include component-docs.html component_name=page.web-component %} + ## Content considerations The content of this component should not be altered. Additional information may be provided the "With Custom Respondent Burden Benefit Type" and "With Children" variations of this component under specific circumstances. diff --git a/src/_components/on-this-page.md b/src/_components/on-this-page.md index 3cbe0cac8..f338ede8b 100644 --- a/src/_components/on-this-page.md +++ b/src/_components/on-this-page.md @@ -1,7 +1,7 @@ --- layout: component -title: On this page -intro-text: "The On this page jump links component summarizes the sections (<h2>s) at the top of long pages and allows users to jump down the page to the respective section." +title: On this Page +intro-text: "The On this Page jump links component summarizes the sections (<h2>s) at the top of long pages and allows users to jump down the page to the respective section." research-title: "On this page jump link" figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=798-1500 status: use-best-practice @@ -21,27 +21,27 @@ anchors: ## Usage -### When to use the On this page jump links component +### When to use the On this Page jump links component - Use this component to quickly tell users what information they can get on that page. - This component is especially helpful for pages with a lot of content, as it helps users navigate longer pages and provides guideposts that bring users deeper into the content. ### When to consider something else -- Don't use the On this page jump links if the content on the page isn't very long. To display this component, the page must have a minimum of two H2 section titles. +- Don't use the On this Page jump links if the content on the page isn't very long. To display this component, the page must have a minimum of two H2 section titles. - If the content you want users to see is too far down the page, consider rearranging the content to achieve the desired hierarchy. -### How to use the On this page jump links component +### How to use the On this Page jump links component - **Keep the first link and its corresponding heading close together,** so users can more easily make the connection that the links correspond to the H2 section titles -- **The content on the page must have a minimum of two H2 section titles to use the On this page jump links.** -- **On this page jump links component pairs well with the Back to top component.** The [Back to top component]({{ site.baseurl }}/components/back-to-top) helps users quickly navigate back to the top of long pages of content. +- **The content on the page must have a minimum of two H2 section titles to use the On this Page jump links.** +- **On this Page jump links component pairs well with the Back to top component.** The [Back to top component]({{ site.baseurl }}/components/back-to-top) helps users quickly navigate back to the top of long pages of content. {% include component-docs.html component_name=page.web-component %} ## Accessibility considerations - **Heading levels should increase only by one.** The proper order of heading levels conveys the structure of the page for screen reader users and provides a natural hierarchy for your content. When heading elements are applied correctly, the page becomes much easier for both screen reader and sighted users to navigate. -- **The focus should be on the destination.** When a user clicks on an item on the On this page component, the focus should move to the heading that it links to. +- **The focus should be on the destination.** When a user clicks on an item on the On this Page component, the focus should move to the heading that it links to. - **Allow enough spacing between components.** Space should be 1.5 rem (36px) from the bottom of the descender to the top of the ascender. -- **On this page jump links should be contained in a navigation landmark** so it can be easily discovered by screen reader users. +- **On this Page jump links should be contained in a navigation landmark** so it can be easily discovered by screen reader users. diff --git a/src/_components/pagination.md b/src/_components/pagination.md index e9a1705c6..59d0e54e5 100644 --- a/src/_components/pagination.md +++ b/src/_components/pagination.md @@ -80,4 +80,4 @@ For more details on implementing search results with pagination, including place type="secondary" > -{% include _component-checklist.html component_name=page.web-component %} \ No newline at end of file +{% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/process-list.md b/src/_components/process-list.md index 270224f1b..54771b2a6 100644 --- a/src/_components/process-list.md +++ b/src/_components/process-list.md @@ -1,7 +1,7 @@ --- layout: component -title: "Process list" -intro-text: "The process list, also known as the subway map, is used in a static informational context to describe the process to apply for a benefit or to provide tracking information to a user where they are in a given process." +title: "Process List" +intro-text: "The Process List, also known as the subway map, is used in a static informational context to describe the process to apply for a benefit or to provide tracking information to a user where they are in a given process." figma-link-web: https://www.figma.com/file/JDFpGLIojfuQwANXScQjqe/VADS-Component-Example-Library?type=design&node-id=35%3A169&mode=design&t=J32RmU6Fjbjuh9bD-1 web-component: va-process-list web: true @@ -43,7 +43,7 @@ anchors: ### Additional guidance for VA -#### Additional uses of a process list +#### Additional uses of a Process List * **For multi-step processes.** In a multi-step process where the user may need to track progress over an extended period. @@ -53,18 +53,18 @@ anchors: ### How this component works -* **Be thoughtful about the number of steps.** A process list should include between three and ten steps to prevent it from getting too unwieldy or confusing. +* **Be thoughtful about the number of steps.** A Process List should include between three and ten steps to prevent it from getting too unwieldy or confusing. * **Do not stack.** Only one instance of this component should appear on a page. * **Do not mash up this component with other components.** The functionality of this component should not be combined with the functionality for other components. For example, using an Accordion to act as the header for a step in the process would be inappropriate usage. Content should be edited to fit the step, provide key information, and be visible by default. Use of the [Details]({{ site.baseurl }}/components/details) component to condense content within a step is permissible. * **Each step must have visible content.** Each step should have both a heading and content that helps describe the step in more detail. Do not collapse or hide all content within a step. An explanation of the step is minimally required. ### Placement -The Process list appears after a start form link on the form [Introduction page]({{ site.baseurl }}/templates/forms/introduction#process-list). Additional calls-to-action to start the application or process that the process list describes can be found within (in the case of apply) and below the list. +The Process List appears after a start form link on the form [Introduction page]({{ site.baseurl }}/templates/forms/introduction#process-list). Additional calls-to-action to start the application or process that the Process List describes can be found within (in the case of apply) and below the list. ### Instances of this component in production -{% include component-example.html alt="An example of the process list component on an Education benefits application." file="/images/components/process-list/VEAP-benefits-2024.png" caption="The VEAP benefits application form uses a process list on the introduction page." width="50%" %} +{% include component-example.html alt="An example of the Process List component on an Education benefits application." file="/images/components/process-list/VEAP-benefits-2024.png" caption="The VEAP benefits application form uses a Process List on the introduction page." width="50%" %} {% include component-docs.html component_name=page.web-component %} @@ -72,8 +72,8 @@ The Process list appears after a start form link on the form [Introduction page] * **List headings should start with a verb.** Examples include "Prepare", "Apply", "Review", etc. * **Make headings clear and concise.** You can always write more content in paragraphs and other HTML elements below the heading. -* **Make process step content clear and concise.** Process list should not be a container for many other components and text. Use plain language and briefly explain the step in the process. -* **Status eyebrow should match context.** When using the optional status eyebrow, make sure the status matches the context of the process list. The provided statuses are pending, active, complete. +* **Make process step content clear and concise.** Process List should not be a container for many other components and text. Use plain language and briefly explain the step in the process. +* **Status eyebrow should match context.** When using the optional status eyebrow, make sure the status matches the context of the Process List. The provided statuses are pending, active, complete. ## Accessibility considerations @@ -86,6 +86,6 @@ The Process list appears after a start form link on the form [Introduction page] ### Additional accessibility considerations for VA * **Don't use headings alone.** Each step should have both a heading and content that helps describe the step in more detail. -* **Use eyebrow status for update.** When using a process list that has a status update the eyebrow feature is required for accessibility. +* **Use eyebrow status for update.** When using a Process List that has a status update the eyebrow feature is required for accessibility. {% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/progress-bar-activity.md b/src/_components/progress-bar-activity.md index cab6d3cbf..d4c03b0c2 100644 --- a/src/_components/progress-bar-activity.md +++ b/src/_components/progress-bar-activity.md @@ -1,7 +1,7 @@ --- layout: component permalink: /components/progress-bar/ -title: "Progress bar - Activity" +title: "Progress Bar - Activity" intro-text: "A progress bar provides status as the system is taking an action on behalf of the user." research-title: Progress bars figma-link-web: https://www.figma.com/design/afurtw4iqQe6y4gXfNfkkk/VADS-Component-Library?node-id=199-1236 @@ -51,5 +51,5 @@ anchors: ## Related -* [Progress bar - Segmented]({{ site.baseurl }}/components/form/progress-bar-segmented) -* [Loading indicator]({{ site.baseurl }}/components/loading-indicator) \ No newline at end of file +* [Progress Bar - Segmented]({{ site.baseurl }}/components/form/progress-bar-segmented) +* [Loading indicator]({{ site.baseurl }}/components/loading-indicator) diff --git a/src/_components/search-filter.md b/src/_components/search-filter.md index cbe53b4d8..ee7601d40 100644 --- a/src/_components/search-filter.md +++ b/src/_components/search-filter.md @@ -10,6 +10,7 @@ anchors: - anchor: Examples - anchor: Usage - anchor: Behavior + - anchor: Accessibility considerations - anchor: Code usage - anchor: Component checklist --- @@ -52,10 +53,11 @@ Faceted search is a way to filter search results by using attributes, or facets, * **Desktop viewport widths:** Place the Search Filter component in the left-side rail, below a full-width Search Input component. * **Refer to the search results template.** Check out the [search results template]({{ site.baseurl }}/templates/search-results) examples for precise placement. +{% include component-docs.html component_name=page.web-component %} + ## Accessibility considerations {% include a11y/search-filters.md %} -{% include component-docs.html component_name=page.web-component %} {% include _component-checklist.html component_name=page.web-component %} diff --git a/src/_components/snackbar.md b/src/_components/snackbar.md index 9b4c0d881..feffc1765 100644 --- a/src/_components/snackbar.md +++ b/src/_components/snackbar.md @@ -55,7 +55,7 @@ anchors: * "Undo" snackbar appears in Messages when moving a message to a folder. * "Try again" snackbar appears in Messages when a draft is not saved successfully. -{% include component-docs.html component_name=page.web-component %} +{% include component-docs.html component_name="va-snackbar" %} ## Content considerations diff --git a/src/_components/summary-box.md b/src/_components/summary-box.md index 0fbe5e074..2b1560461 100644 --- a/src/_components/summary-box.md +++ b/src/_components/summary-box.md @@ -3,9 +3,9 @@ layout: component permalink: /components/summary-box redirect_from: - /components/featured-content -title: "Summary box" +title: "Summary Box" aka: Featured content -intro-text: "The summary box component helps Veterans quickly identify must-read information on a page. Use this component to highlight a small chunk of the most important information on a page, like eligibility criteria or coverage under a particular VA benefit." +intro-text: "The Summary Box component helps Veterans quickly identify must-read information on a page. Use this component to highlight a small chunk of the most important information on a page, like eligibility criteria or coverage under a particular VA benefit." figma-link-web: https://www.figma.com/file/JDFpGLIojfuQwANXScQjqe/VADS-Component-Example-Library?type=design&node-id=1192%3A4460&mode=design&t=vNilCSI60pQBiKkM-1 anchors: - anchor: Examples @@ -35,7 +35,7 @@ mobile-app: false ### Additional guidance for VA -### When to use summary box +### When to use Summary Box * **Highlight the most important information.** The Summary box component is for calling out key details that readers shouldn’t miss. It was originally intended to hold eligibility data exclusively. The content should be "evergreen", not time sensitive. @@ -64,7 +64,7 @@ Summary box is found towards the top of the page after the h1 title of the page #### Eligibility -{% include component-example.html alt="An example of an eligibility summary box block in the Health care eligibility page." file="/images/components/summary-box/eligibility.png" caption="The summary box block is mainly intended for use in highlighting eligibility on VA.gov." width="75%" %} +{% include component-example.html alt="An example of an eligibility Summary Box block in the Health care eligibility page." file="/images/components/summary-box/eligibility.png" caption="The Summary Box block is mainly intended for use in highlighting eligibility on VA.gov." width="75%" %} {% capture example_like_this_1 %} {% include component-example.html alt="Example of the Link, Collection, Related links component to show a list of links." file="/images/components/link/collection-major.png" caption="Use the Major links variation of the Link - Collection component for a collection of links." %} @@ -86,9 +86,7 @@ Summary box is found towards the top of the page after the h1 title of the page {% include _like-this-not-this.html like_this=example_like_this_2 not_this=example_not_this_2 %} -## Code usage - -Code for this component is shown in Storybook. Follow the link provided in [examples](#examples). +{% include component-docs.html component_name=page.web-component %} ## Content considerations diff --git a/src/_components/tag/index.md b/src/_components/tag/index.md index fe625668b..ca4103d69 100644 --- a/src/_components/tag/index.md +++ b/src/_components/tag/index.md @@ -50,9 +50,8 @@ Used to draw attention to new or important content, categorize information, or i * **Tags shouldn't be interactive.** Tags are designed to be static labels that convey information, not clickable elements. They shouldn't have hover, focus, or active states that suggest interactivity. * **Don't overdo it.** If everything on a page is called out as important, nothing is important. -## Code usage +{% include component-docs.html component_name=page.web-component %} -Refer to the [Tag component in Storybook]({{ site.baseurl }}/storybook/?path=/docs/components-tag--docs) for detailed code usage documentation. ## Accessibility considerations diff --git a/src/_components/telephone.md b/src/_components/telephone.md index 5f9c21556..4fbe620a0 100644 --- a/src/_components/telephone.md +++ b/src/_components/telephone.md @@ -91,4 +91,4 @@ mobile-app: true ## Accessibility considerations -* Teams should not add aria labels on phone numbers or TTY. If you have questions, contact the Accessibility Design Experience (ADE) Team. \ No newline at end of file +* Teams should not add aria labels on phone numbers or TTY. If you have questions, contact the Accessibility Design Experience (ADE) Team. diff --git a/src/_components/template.md b/src/_components/template.md index c6fd37bb1..388ff3c77 100644 --- a/src/_components/template.md +++ b/src/_components/template.md @@ -109,4 +109,4 @@ This is the Code Usage section. Note that the header is inside this include. * Links to related components. This is the Component checklist section. Note that the header is inside this include. - \ No newline at end of file + diff --git a/src/_components/text.md b/src/_components/text.md index 0b1374041..575ec3613 100644 --- a/src/_components/text.md +++ b/src/_components/text.md @@ -54,4 +54,4 @@ There are 9 variations of the Text component. * Use a Body variation (large, medium, small, x-small) for body copy. * Use the Display variation for larger display text. -{% include component-docs.html component_name=page.web-component %} +{% include component-docs.html component_name="va-text" %} diff --git a/src/_includes/component-docs.html b/src/_includes/component-docs.html index 43714d577..4b1f98c8f 100644 --- a/src/_includes/component-docs.html +++ b/src/_includes/component-docs.html @@ -8,9 +8,11 @@ {% endfor %} {% comment %} Check if we have mobile app component data {% endcomment %} +{% comment %} Support optional mobile_component_name parameter for cases where mobile uses different naming {% endcomment %} +{% assign mobile_lookup_name = include.mobile_component_name | default: include.component_name %} {% assign has_mobile_component = false %} {% for mobile_app_component in site.data.mobile-app-component-docs-source.components %} - {% if mobile_app_component.tag == include.component_name %} + {% if mobile_app_component.tag == mobile_lookup_name %} {% assign has_mobile_component = true %} {% break %} {% endif %} @@ -21,257 +23,69 @@

Code usage

-{% comment %} Check if we have both web and mobile app to determine if we need tabs {% endcomment %} -{% assign has_web = false %} -{% assign has_mobile = false %} +{% comment %} + Generate Storybook documentation paths: + - Web components: components-{component-tag}--docs + - Mobile components: va-mobile_{component-name-without-va-prefix-with-underscores}--docs + + Note: Some USWDS components may use uswds- prefix instead of components-. + If the generated link doesn't work, you may need to manually specify the correct path. +{% endcomment %} {% if has_web_component and page.web == true %} + {% comment %} Generate web component Storybook path and extract plain language name {% endcomment %} + {% comment %} Use actual mappings extracted from existing storybook-preview includes {% endcomment %} + + {% assign uswds_components = "va-accordion,va-additional-info,va-alert,va-breadcrumbs,va-button,va-button-pair,va-checkbox,va-checkbox-group,va-combo-box,va-file-input,va-memorable-date,va-modal,va-pagination,va-privacy-agreement,va-process-list,va-radio,va-search-input,va-segmented-progress-bar,va-select,va-statement-of-truth,va-summary-box,va-table,va-text-input,va-textarea" | split: "," %} + {% assign no_prefix_components = "va-button-segmented" | split: "," %} + + {% if no_prefix_components contains include.component_name %} + {% assign web_storybook_path = include.component_name | append: "--docs" %} + {% elsif uswds_components contains include.component_name %} + {% assign web_storybook_path = "uswds-" | append: include.component_name | append: "--docs" %} + {% else %} + {% assign web_storybook_path = "components-" | append: include.component_name | append: "--docs" %} + {% endif %} + + {% assign web_component_name = include.component_name %} + + {% comment %} Extract componentName from docsTags for plain language display name {% endcomment %} {% for component in site.data.component-docs.components %} {% if component.tag == include.component_name %} - {% if component.props != empty or component.events != empty %} - {% assign has_web = true %} - {% endif %} - {% break %} - {% endif %} - {% endfor %} -{% endif %} - -{% if has_mobile_component and page.mobile-app == true %} - {% for mobile_app_component in site.data.mobile-app-component-docs-source.components %} - {% if mobile_app_component.tag == include.component_name %} - {% if mobile_app_component.props != empty or mobile_app_component.events != empty %} - {% assign has_mobile = true %} - {% endif %} - {% break %} - {% endif %} - {% endfor %} -{% endif %} - -{% if has_web and has_mobile %} - {% comment %} Use tabs when both platforms are supported {% endcomment %} - - - - -

Web

- - {% for component in site.data.component-docs.components %} - {% if component.tag == include.component_name %} - {% if component.props != empty %} -
-

Attributes and Properties

- - - - Property - Attribute - Type - Default - Description - - {% for prop in component.props %} - - {{ prop.name }} - {{ prop.attr }} - {% if prop.type %}{{ prop.type }}{% endif %} - {% if prop.default %}{{ prop.default }}{% endif %} - {{ prop.docs | markdownify }} - - {% endfor %} - -
- {% endif %} - - {% if component.events != empty %} -
-

Events

- - - - Name - Description - - {% for event in component.events %} - - {{ event.event }} - {{ event.docs }} - - {% endfor %} - -
- {% endif %} + {% for tag in component.docsTags %} + {% if tag.name == "componentName" %} + {% assign web_component_name = tag.text %} {% break %} {% endif %} {% endfor %} -
- - - - {% assign storybook_name = include.component_name | replace: 'va-', '' | replace: '-', '_' %} - - {% for mobile_app_component in site.data.mobile-app-component-docs-source.components %} - {% if mobile_app_component.tag == include.component_name %} - -

Mobile app

- - {% if mobile_app_component.props != empty %} -
-

Props

- - - - Property - Type - Default - Description - - {% for prop in mobile_app_component.props %} - - {{ prop.name }} - {% if prop.type %}{{ prop.type }}{% endif %} - {% if prop.default %}{{ prop.default }}{% endif %} - {{ prop.docs | markdownify }} - - {% endfor %} - -
- {% endif %} - - {% if mobile_app_component.events != empty %} -
-

Events

- - - - Name - Description - - {% for event in mobile_app_component.events %} - - {{ event.name }} - {{ event.docs }} - - {% endfor %} - -
- {% endif %} - - {% break %} + {% break %} {% endif %} - {% endfor %} -
-
- -{% else %} -{% comment %} Show individual sections when only one platform is supported {% endcomment %} -{% if page.web == true and has_web == true %} -

Web

-{% for component in site.data.component-docs.components %} -{% if component.tag == include.component_name %} -{% if component.props != empty %} -
-

Attributes and Properties

- - - -Property -Attribute -Type -Default -Description - -{% for prop in component.props %} - -{{ prop.name }} -{{ prop.attr }} -{% if prop.type %}{{ prop.type }}{% endif %} -{% if prop.default %}{{ prop.default }}{% endif %} -{{ prop.docs | markdownify }} - -{% endfor %} - -
-{% endif %} - -{% if component.events != empty %} -
-

Events

- - -Name -Description - -{% for event in component.events %} - -{{ event.event }} -{{ event.docs }} - -{% endfor %} - -
-{% endif %} -{% break %} -{% endif %} -{% endfor %} -{% endif %} -{% endif %} - -{% comment %} Mobile App Component Documentation - only show if not using tabs {% endcomment %} -{% if page.mobile-app == true and has_mobile == true %} -{% unless has_web == true %} -{% assign storybook_name = include.component_name | replace: 'va-', '' | replace: '-', '_' %} - -{% for mobile_app_component in site.data.mobile-app-component-docs-source.components %} -{% if mobile_app_component.tag == include.component_name %} - -

Mobile app

- -{% if mobile_app_component.props != empty %} -
-

Props

- - - - Property - Type - Default - Description - - {% for prop in mobile_app_component.props %} - - {{ prop.name }} - {% if prop.type %}{{ prop.type }}{% endif %} - {% if prop.default %}{{ prop.default }}{% endif %} - {{ prop.docs | markdownify }} - - {% endfor %} - -
-{% endif %} - -{% if mobile_app_component.events != empty %} -
-

Events

+ {% endfor %} - - - Name - Description - - {% for event in mobile_app_component.events %} - - {{ event.name }} - {{ event.docs }} - - {% endfor %} - -
+

+ +

{% endif %} - {% break %} - {% endif %} - {% endfor %} - {% endunless %} +{% if has_mobile_component and page.mobile-app == true %} + {% comment %} Generate mobile component Storybook path using mobile_lookup_name {% endcomment %} + {% assign mobile_component_name = mobile_lookup_name | replace: 'va-', '' | replace: '-', '_' %} + {% assign mobile_storybook_path = "va-mobile_" | append: mobile_component_name | append: "--docs" %} + + {% comment %} Create readable name for mobile component {% endcomment %} + {% assign mobile_display_name = mobile_lookup_name | replace: 'va-', '' | replace: '-', ' ' | capitalize %} + +

+ +

{% endif %} {% endif %}