@brightspace-ui/core 3.58.0 → 3.59.0
Sign up to get free protection for your applications and to get access to all the features.
- package/components/alert/README.md +28 -24
- package/package.json +1 -1
@@ -34,33 +34,31 @@ Alerts communicate critical information relating to the state of the system and
|
|
34
34
|
|
35
35
|
<d2l-button id="open" style="align-self:center;display:none;">Show Alerts</d2l-button>
|
36
36
|
<d2l-alert id="alert" type="default" button-text="Undo" has-close-button>
|
37
|
-
|
37
|
+
Inline Alerts can be placed anywhere in the page content
|
38
38
|
</d2l-alert>
|
39
39
|
<d2l-alert-toast id="alert-toast" type="success" open no-auto-close>
|
40
|
-
|
40
|
+
Toast Alerts appear at the botttom of the viewport
|
41
41
|
</d2l-alert-toast>
|
42
42
|
```
|
43
43
|
|
44
44
|
## Inline Alert [d2l-alert]
|
45
45
|
|
46
|
-
|
46
|
+
Use an inline alert if there is important information a user needs to know while performing a task; the alert remains visible until the user takes action or dismisses it.
|
47
47
|
|
48
48
|
### Best Practices
|
49
49
|
|
50
50
|
<!-- docs: start best practices -->
|
51
51
|
<!-- docs: start dos -->
|
52
|
-
*
|
53
|
-
*
|
54
|
-
*
|
55
|
-
* Do provide a control to dismiss the alert and prevent the message from displaying again, if applicable
|
56
|
-
* Do use sentence case for alert text, but avoid unnecessary punctuation by not placing periods at the end of single sentences
|
52
|
+
* Use an alert to highlight information that requires the user’s action or attention
|
53
|
+
* Provide a clear call to action if it can help resolve the alert
|
54
|
+
* Use sentence case for alert text and avoid unnecessary punctuation by not placing periods at the end of single sentences
|
57
55
|
<!-- docs: end dos -->
|
58
56
|
|
59
57
|
<!-- docs: start donts -->
|
60
|
-
* Don
|
61
|
-
*
|
62
|
-
* Don't
|
63
|
-
* Don
|
58
|
+
* Don't display more than one paragraph of text
|
59
|
+
* Avoid overusing them — the more commonly alerts appear, the less effective they will be
|
60
|
+
* Don't use them for promotional material or information that is not relevant to the user’s workflow
|
61
|
+
* Don’t use them for validation errors – instead, use the [Form](../../components/form) component for a consistent user experience
|
64
62
|
<!-- docs: end donts -->
|
65
63
|
<!-- docs: end best practices -->
|
66
64
|
|
@@ -71,7 +69,7 @@ The `d2l-alert` component can be used to communicate important information relat
|
|
71
69
|
</script>
|
72
70
|
|
73
71
|
<d2l-alert type="default" button-text="Undo">
|
74
|
-
|
72
|
+
An inline alert message
|
75
73
|
</d2l-alert>
|
76
74
|
```
|
77
75
|
<!-- docs: start hidden content -->
|
@@ -92,20 +90,20 @@ The `d2l-alert` component can be used to communicate important information relat
|
|
92
90
|
|
93
91
|
## Toast Alert [d2l-alert-toast]
|
94
92
|
|
95
|
-
|
96
|
-
|
93
|
+
Use a toast alert to provide feedback about an operation the user has just initiated when the result of that operation may not be apparent or obvious to the user. Toast alerts appear at the bottom of the viewport and disappear after 4 seconds by default.
|
94
|
+
|
97
95
|
### Best Practices
|
98
96
|
<!-- docs: start best practices -->
|
99
97
|
<!-- docs: start dos -->
|
100
|
-
*
|
101
|
-
*
|
102
|
-
*
|
98
|
+
* Use to convey results of a user's action when the result is not otherwise obvious
|
99
|
+
* Keep text brief — toasts should rarely spill onto more than one line at any screen size
|
100
|
+
* Use specific language — “Assignment saved” is more informative than “Successfully saved”
|
103
101
|
<!-- docs: end dos -->
|
104
102
|
<!-- docs: start donts -->
|
105
|
-
*
|
106
|
-
* Don't allow the close button to be blocked by other elements
|
107
|
-
* Don’t use
|
108
|
-
*
|
103
|
+
* If possible, avoid displaying multiple toasts — see [Multiple Toast Alerts](#multiple-toast-alerts)
|
104
|
+
* Don't allow the close button to be blocked by other elements; users shouldn't have to wait for the toast alert to go away on its own
|
105
|
+
* Don’t use for instructions or critical information since toast alerts disappear and can be easily missed or ignored — use an [Inline Alert](#d2l-alert) instead
|
106
|
+
* Avoid having two lines with `subtext` — toasts should be very brief
|
109
107
|
<!-- docs: end donts -->
|
110
108
|
<!-- docs: end best practices -->
|
111
109
|
|
@@ -133,7 +131,7 @@ a pop-up at the bottom of the screen that automatically dismisses itself by defa
|
|
133
131
|
<d2l-button id="open" style="align-self:center;display:none;">Show Alert</d2l-button>
|
134
132
|
<!-- docs: end hidden content -->
|
135
133
|
<d2l-alert-toast type="default" no-auto-close open>
|
136
|
-
A default toast alert
|
134
|
+
A default toast alert
|
137
135
|
</d2l-alert-toast>
|
138
136
|
```
|
139
137
|
|
@@ -155,7 +153,7 @@ a pop-up at the bottom of the screen that automatically dismisses itself by defa
|
|
155
153
|
|
156
154
|
### Multiple Toast Alerts
|
157
155
|
|
158
|
-
|
156
|
+
Avoid displaying more than one toast message at a time unless absolutely necessary, since they disappear after 4 seconds and can be difficult to read for some users. It's often better to use an [inline alert](#d2l-alert) so that users have time to discover and read the message.
|
159
157
|
|
160
158
|
For cases where multiple toast alerts are unavoidable, new toast messages will appear at the bottom and push older messages upward.
|
161
159
|
|
@@ -189,3 +187,9 @@ For cases where multiple toast alerts are unavoidable, new toast messages will a
|
|
189
187
|
Third toast alert
|
190
188
|
</d2l-alert-toast>
|
191
189
|
```
|
190
|
+
|
191
|
+
## Accessibility
|
192
|
+
|
193
|
+
[Inline Alerts](#d2l-alert) are meant to draw attention without interrupting the user's flow, so they do not use the ARIA `alert` role. This means screen reader users do not hear them until encountering them in the content (as intended).
|
194
|
+
|
195
|
+
[Toast Alerts](#d2l-alert-toast) leverage the ARIA `alert` role in alignment with the [W3C Alert Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/alert/), so an assertive live region is created which causes the content of the alert to be announced immediately. This can interrupt the user, so it should be used sparingly as per our [Best Practices](#best-practices-1).
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.59.0",
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
5
5
|
"type": "module",
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|