@brightspace-ui/core 1.175.0 → 1.175.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
# Backdrop
|
|
2
|
-
|
|
3
|
-
## d2l-backdrop
|
|
1
|
+
# Backdrop [d2l-backdrop]
|
|
4
2
|
|
|
5
3
|
The `d2l-backdrop` element is a web component to display a semi-transparent backdrop behind a specified sibling element. It also hides elements other than the target from assistive technologies by applying `role="presentation"` and `aria-hidden="true"`.
|
|
6
4
|
|
|
5
|
+
<!-- docs: demo live name:d2l-backdrop size:small -->
|
|
7
6
|
```html
|
|
8
7
|
<script type="module">
|
|
8
|
+
import '@brightspace-ui/core/components/button/button.js';
|
|
9
9
|
import '@brightspace-ui/core/components/backdrop/backdrop.js';
|
|
10
|
+
import '@brightspace-ui/core/components/switch/switch.js';
|
|
10
11
|
</script>
|
|
11
12
|
<style>
|
|
12
|
-
#target { position: relative; z-index: 1000; }
|
|
13
|
+
#target { position: relative; z-index: 1000; margin: 40px; }
|
|
13
14
|
</style>
|
|
14
|
-
|
|
15
|
-
<div id="target"><button>
|
|
16
|
-
<d2l-backdrop for-target="target"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
<div>
|
|
16
|
+
<div id="target"><d2l-button primary>Toggle backdrop</d2l-button></div>
|
|
17
|
+
<d2l-backdrop for-target="target"></d2l-backdrop>
|
|
18
|
+
</div>
|
|
19
|
+
<span>Background content</span>
|
|
20
|
+
<script>
|
|
21
|
+
const backdrop = document.querySelector('d2l-backdrop');
|
|
22
|
+
document.querySelector('#target > d2l-button').addEventListener('click', () => {
|
|
23
|
+
backdrop.shown = !backdrop.shown;
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
<!-- docs: start hidden content -->
|
|
29
|
+
### Properties:
|
|
28
30
|
|
|
29
31
|
| Property | Type | Description |
|
|
30
32
|
|--|--|--|
|
|
@@ -36,3 +38,4 @@ button.addEventListener('click', () => {
|
|
|
36
38
|
## Future Enhancements
|
|
37
39
|
|
|
38
40
|
Looking for an enhancement not listed here? Create a GitHub issue!
|
|
41
|
+
<!-- docs: end hidden content -->
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Loading Spinners
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A loading spinner indicates that something is happening and we don't know how long it will take.
|
|
4
|
+
|
|
4
5
|
<!-- docs: demo name:d2l-loading-spinner -->
|
|
5
6
|
```html
|
|
6
7
|
<script type="module">
|
|
@@ -13,6 +14,21 @@ The loading spinner can be used to indicate to a user that the current page/comp
|
|
|
13
14
|

|
|
14
15
|
<!-- docs: end hidden content -->
|
|
15
16
|
|
|
17
|
+
## Best Practices
|
|
18
|
+
|
|
19
|
+
<!-- docs: start best practices -->
|
|
20
|
+
<!-- docs: start dos -->
|
|
21
|
+
* Use a loading spinner when the user initiates an action with indeterminate length, and it's expected to take longer than a couple seconds
|
|
22
|
+
* Adjust the size proportionally to the area that is being loaded; small for a widget or dropdown, larger for a large list or an entire page
|
|
23
|
+
* For a better user experience, use a Skeleton loader instead when possible
|
|
24
|
+
<!-- docs: end dos -->
|
|
25
|
+
|
|
26
|
+
<!-- docs: start donts -->
|
|
27
|
+
* Don't use a loading spinner it if the user's action is nearly instant, as it may appear to flash or flicker on the screen before disappearing
|
|
28
|
+
* Avoid using multiple spinners on one screen, as this can overwhelm users and create anxiety - see Skeleton loaders instead
|
|
29
|
+
<!-- docs: end donts -->
|
|
30
|
+
<!-- docs: end best practices -->
|
|
31
|
+
|
|
16
32
|
## Loading Spinner [d2l-loading-spinner]
|
|
17
33
|
|
|
18
34
|
<!-- docs: demo live name:d2l-loading-spinner -->
|
|
@@ -67,7 +67,7 @@ if (!document.head.querySelector('#d2l-typography-font-face')) {
|
|
|
67
67
|
|
|
68
68
|
.d2l-typography:lang(ar),
|
|
69
69
|
.d2l-typography :lang(ar) {
|
|
70
|
-
font-family: '
|
|
70
|
+
font-family: 'Segoe UI', 'Geeza Pro', sans-serif;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.d2l-typography:lang(zh),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.175.
|
|
3
|
+
"version": "1.175.1",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"repository": "https://github.com/BrightspaceUI/core.git",
|
|
6
6
|
"publishConfig": {
|