You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guidelines/components/dialog/README.md
+73-71Lines changed: 73 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,12 @@ A modal dialog is a message box or child window that requires user interaction b
5
5
## Usage
6
6
7
7
8
-
* The dialog always should have a title to introduce the actions or information that will get displayed on the screen.
9
-
* Can contain a descriptive text or a phrase related to the action that triggered the dialog.
10
-
* Can have some combinations of actions, like buttons to accept/cancel the action. There can be one, two or more buttons.
8
+
* The dialog always should have a title to introduce the actions or information that will get displayed on the screen
9
+
* Can contain a descriptive text or a phrase related to the action that triggered the dialog
10
+
* Can have some combinations of actions, like buttons to accept/cancel the action. There can be one, two or more buttons
11
11
* If the dialog is not including a cancel action, provide a way to close it
12
-
* Modal dialog boxes should overlay only a portion of the underlying page to keep the user oriented within the workflow.
13
-
* The modal dialog should emerge from the top of the screen and be centered horizontally on the parent page.
14
-
* Modal dialog features should be used sparingly, as they disrupt workflow, but can be advantageous when used properly
15
-
12
+
* Modal dialog boxes should overlay only a portion of the underlying page to keep the user oriented within the workflow
13
+
16
14
17
15
## Anatomy
18
16
@@ -24,6 +22,23 @@ A modal dialog is a message box or child window that requires user interaction b
24
22
4. Dialog actions
25
23
5. Content
26
24
25
+
## Content
26
+
27
+

28
+
29
+
_Example of a dialog using Halstack components as content_
30
+
31
+
Any content (Halstack components or custom) can be placed inside the dialog component, try always to avoid scrolling.
32
+
33
+
34
+
## Overlay
35
+
36
+

37
+
38
+
_Example of the overlay usage_
39
+
40
+
The overlay element makes possible to get the user attention into the dialog creating a layer between the actual application and the modal information showed in the user interface.
41
+
27
42
28
43
## Design Specifications
29
44
@@ -45,20 +60,20 @@ _Design specifications for dialog component_
45
60
|`closeIconBackgroundColor`| Icon close background |`none`| none |
46
61
|`closeIconBorderColor`| Icon close border |`none`| none |
47
62
48
-
### Padding
63
+
### Typography
49
64
50
-
padding | value
51
-
-- | --
52
-
`xxsmall` | 6px
53
-
`xsmall` | 16px
54
-
`small`_(default)_ | 24px
55
-
`medium` | 36px
56
-
`large` | 48px
57
-
`xlarge` | 64px
58
-
`xxlarge` | 100px
65
+
| Component token | Element | Core token | Value |
The overlay element makes possible to get the user attention into the dialog creating a layer between the actual application and the modal information showed in the user interface.
And also apply different values to each side of the component:
128
+
`top``bottom``left``right`
129
129
130
-
There are some elements that require some guidance to use it on the dialog component, based on the nature of the component or the behavior that it has in the ecosystem. Due to resource loading or prompting messages for the user, special guides are defined to incorporate these scenarios.
130
+
## Accesibility
131
131
132
-
For the case that the application has a modal opened and it needs to load data from the server, we can represent this situation to the user in several ways.
132
+
### WCAG
133
133
134
-
- One option can be to stick to the default implementation of the spinner component and use it in the overlay mode, overlapping the loading element to the rest of the interface components and make it clear that the application is getting some resources from the APIs.
135
-
- Another approach, to avoid render an overlay on top of another overlay is to integrate the loading indicator into the modal window. This can be done placing the spinner near the title of the dialog, on the right side and the small variations of the component. Using this way we make explicit to the user that the applications are working on something without the need to distract the attention from the dialog.
134
+
* Understanding WCAG 2.2 - [2.1.2 No Keyboard Trap](https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html)
0 commit comments