diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/center-aligned-modal.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/center-aligned-modal.png deleted file mode 100644 index 510c73bd30..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/center-aligned-modal.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/destructive-confirmation-dialog-steps.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/destructive-confirmation-dialog-steps.png deleted file mode 100644 index 37c78d9372..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/destructive-confirmation-dialog-steps.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/destructive-confirmation-dialog.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/destructive-confirmation-dialog.png deleted file mode 100644 index ca5fdfecdf..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/destructive-confirmation-dialog.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-edit-dialog.svg b/packages/documentation-site/patternfly-docs/content/components/modal/img/edit-modal.svg similarity index 100% rename from packages/documentation-site/patternfly-docs/content/components/modal/img/modal-edit-dialog.svg rename to packages/documentation-site/patternfly-docs/content/components/modal/img/edit-modal.svg diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/error-dialog.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/error-dialog.png deleted file mode 100644 index b78a155dec..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/error-dialog.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-error-dialog.svg b/packages/documentation-site/patternfly-docs/content/components/modal/img/error-modal.svg similarity index 100% rename from packages/documentation-site/patternfly-docs/content/components/modal/img/modal-error-dialog.svg rename to packages/documentation-site/patternfly-docs/content/components/modal/img/error-modal.svg diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-basic.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-basic.png deleted file mode 100644 index 9d5155d67c..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-basic.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-call-outs.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-call-outs.png deleted file mode 100644 index 9c5a9bcf75..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-call-outs.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-with-help.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-with-help.png deleted file mode 100644 index fdad015b21..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-with-help.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/non-destructive-confirmation-dialog.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/non-destructive-confirmation-dialog.png deleted file mode 100644 index f4a7156453..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/non-destructive-confirmation-dialog.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/passive-dialog.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/passive-dialog.png deleted file mode 100644 index f5bbe99d19..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/passive-dialog.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/modal-passive-dialog.svg b/packages/documentation-site/patternfly-docs/content/components/modal/img/passive-modal.svg similarity index 100% rename from packages/documentation-site/patternfly-docs/content/components/modal/img/modal-passive-dialog.svg rename to packages/documentation-site/patternfly-docs/content/components/modal/img/passive-modal.svg diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/secondary-destructive-action.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/secondary-destructive-action.png deleted file mode 100644 index 1630f6d301..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/secondary-destructive-action.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expiration-modal.svg b/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expiration-modal.svg new file mode 100644 index 0000000000..dcfcf3f493 --- /dev/null +++ b/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expiration-modal.svg @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expired-login.svg b/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expired-login.svg new file mode 100644 index 0000000000..f67f03d0e3 --- /dev/null +++ b/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expired-login.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expired-modal.svg b/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expired-modal.svg new file mode 100644 index 0000000000..fa5961264e --- /dev/null +++ b/packages/documentation-site/patternfly-docs/content/components/modal/img/session-expired-modal.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/img/top-aligned-modal.png b/packages/documentation-site/patternfly-docs/content/components/modal/img/top-aligned-modal.png deleted file mode 100644 index eae4274bee..0000000000 Binary files a/packages/documentation-site/patternfly-docs/content/components/modal/img/top-aligned-modal.png and /dev/null differ diff --git a/packages/documentation-site/patternfly-docs/content/components/modal/modal.md b/packages/documentation-site/patternfly-docs/content/components/modal/modal.md index dab74b4611..d34ef7d371 100644 --- a/packages/documentation-site/patternfly-docs/content/components/modal/modal.md +++ b/packages/documentation-site/patternfly-docs/content/components/modal/modal.md @@ -26,7 +26,7 @@ For guidance on writing copy for modals, refer to the [content considerations](# ## Usage -Use a modal to communicate critical information that requires user input or action. +Use a **modal** to communicate critical information that requires user input or action. Modals can: @@ -38,29 +38,31 @@ Modals can: Don’t use a modal unless its information is vital to user success and worth disrupting a user’s task flow. - ## Variations -Modals serve several functions in a UI and appear in four main types: +Modals serve several functions in a UI and appear in the following main types: + +* [Confirmation modals](#confirmation-modals) -* [Confirmation dialogs](#confirmation-dialogs) +* [Edit modals](#edit-modals) -* [Edit dialogs](#edit-dialogs) +* [Error modals](#error-modals) -* [Error dialogs](#error-dialogs) +* [Passive modals](#passive-modals) -* [Passive dialogs](#passive-dialogs) +* [Session expiration modals](#session-expiration-modals) -* [Input dialogs](#input-dialogs) +* [Input modals](#input-modals) +* [Modals with help](#modals-with-help) -### Confirmation dialogs +### Confirmation modals -Use a confirmation dialog to validate user decisions and communicate their consequences. Confirmation dialogs can confirm non-destructive and destructive actions. +Use a confirmation modal to validate user decisions and communicate their consequences. Confirmation modals can confirm non-destructive and destructive actions. #### Confirm a non-destructive action
-![A side-by-side comparison of unsuccessful and successful confirmaton dialogs for leaving a page without saving.](./img/modal-non-destructive.svg) +![A side-by-side comparison of unsuccessful and successful confirmaton modals for leaving a page without saving.](./img/modal-non-destructive.svg)
When confirming a non-destructive action, provide specific context about what will happen once a user confirms it. @@ -68,7 +70,7 @@ When confirming a non-destructive action, provide specific context about what wi #### Confirm a destructive action
-![A side-by-side comparison of unsuccessful and successful destructive confirmaton dialogs.](./img/modal-destructive.svg) +![A side-by-side comparison of unsuccessful and successful destructive confirmaton modals.](./img/modal-destructive.svg)
Use a [primary button](/components/button/design-guidelines#primary-button) to confirm a destructive action. If the action carries serious consequences, then use a [danger button](/components/button/design-guidelines#danger-button) instead. @@ -77,49 +79,72 @@ If an action is difficult or impossible to undo, add a warning icon beside the h If a destructive action has serious consequences, consider adding an additional step before its destructive button becomes active. Additional confirmation measures like [text input](/components/forms/text-input/design-guidelines) fields safeguard a user from accidentally completing the action. -When a text input field is added to a confirmation dialog, the danger button will only become enabled once a user enters the entire word or phrase. +When a text input field is added to a confirmation modal, the danger button will only become enabled once a user enters the entire word or phrase.
-![Example of a destructive confirmation dialog that requires an input field be filled before continuing.](./img/modal-destructive-text-input.svg) +![Example of a destructive confirmation modal that requires an input field be filled before continuing.](./img/modal-destructive-text-input.svg)
-### Edit dialogs +### Edit modals -Use an edit dialog for managing assets. Edit dialogs contain multiple actions which can include, but are not limited to, saving your changes or deleting the asset. The primary action in the dialog should use a primary button, the secondary should use a secondary button, and the cancel button should remain a link button. +Use an edit modal for managing assets. Edit modals contain multiple actions which can include, but are not limited to, saving your changes or deleting the asset. The primary action in the modal should use a primary button, the secondary should use a secondary button, and the cancel button should remain a link button. -For example, and edit dialogue might contain a "Save" button as the primary action, and a "Delete" button as a secondary action. If the secondary action is destructive, the button should be styled as a [secondary danger button](/components/button/#variant-examples). Additionally, it should be aligned to the right-side of the modal, directly across from the primary action and cancel buttons. +For example, an edit modal might contain a "Save" button as the primary action, and a "Delete" button as a secondary action. If the secondary action is destructive, the button should be styled as a [secondary danger button](/components/button/#variant-examples). Additionally, it should be aligned to the right-side of the modal, directly across from the primary action and cancel buttons.
-![Example of an edit dialog.](./img/modal-edit-dialog.svg) +![Example of an edit modal.](./img/edit-modal.svg)
When using destructive actions, ensure that the user is informed about the consequences of taking this action. Review the general guidelines for [danger button](/components/button/design-guidelines#danger-button) and destructive actions for additional guidance. -### Error dialogs +### Error modals
-![Example of an error dialog, with and without an optional error icon.](./img/modal-error-dialog.svg) +![Example of an error modal, with and without an optional error icon.](./img/error-modal.svg)
-Use an error dialog to inform users of problems that interrupt normal or expected behavior. Briefly contextualize the problem and why it happened, then provide actionable steps toward a solution. +Use an error modal to inform users of problems that interrupt normal or expected behavior. Briefly contextualize the problem and why it happened, then provide actionable steps toward a solution. Learn more about writing error messages in our [error message guidelines](/content-design/writing-guides/error-messages). -Error dialogs may use an error icon for visual emphasis. +Error modals may use an error icon for visual emphasis. -### Passive dialogs +### Passive modals
-![Example of a passive dialog, with and without an optional warning icon.](./img/modal-passive-dialog.svg) +![Example of a passive modal, with and without an optional warning icon.](./img/passive-modal.svg)
-Use a passive dialog to communicate critical and immediately relevant information like the status of an application or an action’s result. Passive dialog content should require or lead to user action. +Use a passive modal to communicate critical and immediately relevant information like the status of an application or an action’s result. Passive modal content should require or lead to user action. + +Passive modals can also notify the user about the status or duration of a critical process, especially if the process may take an unusual amount of time to complete. -Passive dialogs can also notify the user about the status or duration of a critical process, especially if the process may take an unusual amount of time to complete. +Never use a passive modal for non-critical information. Instead, use an [inline alert](/components/alert/design-guidelines/#inline-alerts) or a [toast alert](/components/alert/design-guidelines/#toast-alerts). -Never use a passive dialog for non-critical information. Instead, use an [inline alert](/components/alert/design-guidelines/#inline-alerts) or a [toast alert](/components/alert/design-guidelines/#toast-alerts). +### Session expiration modals -### Input dialogs +Use a session expiration modal to communicate that a user will soon be logged out of their account. This modal should display the time remaining (in seconds) until the user will be logged out, and that number should dynamically update as time passes, like a countdown. + +
+![A modal is placed on top of a generic desktop page, with a yellow warning icon and a "Session expiring" title. There are two pink annotations pointing to different parts of the modal: one pointing to the amount of time remaining and one pointing to the footer actions.](./img/session-expiration-modal.svg) +
+ +1. **Timeout countdown:** Display a dynamic countdown until the user's session will expire. +2. **Actions:** Display options that allow users to extend their session before timeout or choose to log out. + +Once a user's session has expired, the modal should be updated to display a "Session expired" message that informs users they have already been logged out. + +
+![A modal is placed atop a gray background, with a red danger icon and a "Session expired" title. There's a single button in the footer with the label "Return to login page".](./img/session-expired-modal.svg) +
+ +If you choose to return the user back to the login page when their session expires, even if this happens in the background, you can display an inline info alert on the [login page](/components/login-page) that provides context. + +
+![An alert is placed within a login page, above the username and password fields, with a purple information icon and a "Session expired" title.](./img/session-expired-login.svg) +
+ +### Input modals Users may need to provide additional input to complete an action. To accomplish this, use forms or other elements within the modal, like in a [modal wizard](/components/wizard#within-modal). @@ -182,15 +207,18 @@ Example headline: *Permanently delete database?*
Example buttons: *Delete* and *Cancel*
For more button guidance, see our [button label guidelines](/components/button/design-guidelines#content). -For general content guidance to help write effective modal dialogs, see our [UX writing style guide](/content-design/overview). +For general content guidance to help write effective modals, see our [UX writing style guide](/content-design/overview). + +### Icon use in modals +Icons are optional in modals. Use or omit them as your use case requires. -### Icon use in modal dialogs +| Icon | Description | Usage | +| --- |---|---| +| | **Warning:** Cautions or warns the user of a permanent action, or that information will be deleted upon action completion | Add to confirmation modals or passive modals to indicate a higher level of urgency and importance.| +| | **Danger:** Indicates that an error has occured | Add to error modals. | +| | **Info:** Informs the user of an action or result | Add to confirmation or passive modals to indicate a lower level of urgency. | -Icons are optional in modal dialogs. Use or omit them as your use case requires. +## Accessibility -| Icon | Use case(s) | Usage | -| ------------- |-------------|-------------| -| | **Warning:** Cautions or warns the user of a permanent action, or that information will be deleted upon action completion | Add to confirmation dialogs or passive dialogs to indicate a higher level of urgency and importance.| -| | **Critical Warning:** Indicates that an error has occured | Add to error dialogs. | -| | **Acknowledgement:** Informs the user of an action or result | Add to confirmation or passive dialogs to indicate a lower level of urgency. | +For information regarding accessibility, visit the [modal accessibility tab](/components/modal/accessibility). \ No newline at end of file