@brightspace-ui/core 2.47.2 → 2.47.5
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.
- package/components/description-list/README.md +29 -16
- package/components/description-list/description-list-wrapper.js +6 -6
- package/components/typography/styles.js +1 -1
- package/helpers/README.md +1 -1
- package/helpers/focus.js +3 -3
- package/helpers/prism.js +6 -3
- package/lang/ar.js +1 -1
- package/lang/da.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Description List
|
|
2
|
-
A Description List displays
|
|
2
|
+
A Description List displays static pairs of terms and definitions in a vertical list. In the standard HTML element `dl` these are called "terms" `dt` and "definitions" `dd`.
|
|
3
3
|
|
|
4
4
|
<!-- docs: demo -->
|
|
5
5
|
```html
|
|
@@ -10,16 +10,20 @@ A Description List displays information in a vertical list of key-value pairs. C
|
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Best Practices
|
|
13
|
+
|
|
13
14
|
<!-- docs: start best practices -->
|
|
14
15
|
<!-- docs: start dos -->
|
|
15
|
-
*
|
|
16
|
+
* Keep terms short and scannable
|
|
17
|
+
* Use terms of similar lengths since definitions are aligned to the longest term
|
|
18
|
+
* Use title case for terms and sentence case for definitions
|
|
19
|
+
* Adjust the [responsive breakpoint](#responsive-behavior) to suit your content since longer values may need a higher breakpoint
|
|
16
20
|
<!-- docs: end dos -->
|
|
17
21
|
|
|
18
22
|
<!-- docs: start donts -->
|
|
19
|
-
*
|
|
20
|
-
* Don't
|
|
21
|
-
* Don't
|
|
22
|
-
* Don't
|
|
23
|
+
* Avoid using multiple description lists on one page
|
|
24
|
+
* Don't use empty terms or definitions, both are required
|
|
25
|
+
* Don't use colons in the labels, they're unnecessary
|
|
26
|
+
* Don't end a definition with a period unless it has multiple sentences
|
|
23
27
|
<!-- docs: end donts -->
|
|
24
28
|
<!-- docs: end best practices -->
|
|
25
29
|
|
|
@@ -42,11 +46,14 @@ When the component width is less than the `breakpoint` property, the side-by-sid
|
|
|
42
46
|
return html`
|
|
43
47
|
<d2l-dl-wrapper breakpoint="600">
|
|
44
48
|
<dl>
|
|
45
|
-
<dt>
|
|
46
|
-
<dd>
|
|
49
|
+
<dt>Active Course</dt>
|
|
50
|
+
<dd>Inactive courses are invisible, regardless of start or end dates unless the user’s role has the permission "Can View Inactive Courses"</dd>
|
|
51
|
+
|
|
52
|
+
<dt>Start Date</dt>
|
|
53
|
+
<dd>The start date determines when a course becomes available to learners. Users with the "Can View Course Before Start Date" permission are excluded from this restriction.</dd>
|
|
47
54
|
|
|
48
|
-
<dt>
|
|
49
|
-
<dd>The
|
|
55
|
+
<dt>End Date</dt>
|
|
56
|
+
<dd>The end date determines when a course becomes unavailable to learners. Users with the "Can View Course After End Date" permission are excluded from this restriction.</dd>
|
|
50
57
|
</dl>
|
|
51
58
|
</d2l-dl-wrapper>
|
|
52
59
|
`;
|
|
@@ -60,9 +67,9 @@ When the component width is less than the `breakpoint` property, the side-by-sid
|
|
|
60
67
|
|
|
61
68
|
## Description List Wrapper [d2l-dl-wrapper]
|
|
62
69
|
|
|
63
|
-
The `d2l-dl-wrapper` can be combined with `descriptionListStyles` to apply styling and resize behavior to native `dl` elements.
|
|
70
|
+
The `d2l-dl-wrapper` component can be combined with `descriptionListStyles` to apply styling and resize behavior to native `dl` elements.
|
|
64
71
|
|
|
65
|
-
<!-- docs: demo live name:d2l-test-dl -->
|
|
72
|
+
<!-- docs: demo live name:d2l-test-dl display:block -->
|
|
66
73
|
```html
|
|
67
74
|
<script type="module">
|
|
68
75
|
import { html, LitElement } from 'lit';
|
|
@@ -84,11 +91,17 @@ The `d2l-dl-wrapper` can be combined with `descriptionListStyles` to apply styli
|
|
|
84
91
|
return html`
|
|
85
92
|
<d2l-dl-wrapper breakpoint="${this.breakpoint}">
|
|
86
93
|
<dl>
|
|
87
|
-
<dt>Course
|
|
88
|
-
<dd>
|
|
94
|
+
<dt>Course Name</dt>
|
|
95
|
+
<dd>Brightspace 101B</dd>
|
|
96
|
+
|
|
97
|
+
<dt>Course Code</dt>
|
|
98
|
+
<dd>BSPC 101B</dd>
|
|
99
|
+
|
|
100
|
+
<dt>Start Date</dt>
|
|
101
|
+
<dd>June 14 2022</dd>
|
|
89
102
|
|
|
90
|
-
<dt>
|
|
91
|
-
<dd>
|
|
103
|
+
<dt>Semester</dt>
|
|
104
|
+
<dd>2022 Summer</dd>
|
|
92
105
|
</dl>
|
|
93
106
|
</d2l-dl-wrapper>
|
|
94
107
|
`;
|
|
@@ -4,26 +4,26 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
4
4
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
|
5
5
|
|
|
6
6
|
export const descriptionListStyles = [
|
|
7
|
-
_generateLabelStyles('dt'),
|
|
8
|
-
_generateBodyCompactStyles('dd'),
|
|
7
|
+
_generateLabelStyles('d2l-dl-wrapper > dl > dt'),
|
|
8
|
+
_generateBodyCompactStyles('d2l-dl-wrapper > dl > dd'),
|
|
9
9
|
css`
|
|
10
|
-
|
|
10
|
+
d2l-dl-wrapper {
|
|
11
11
|
--d2l-dl-wrapper-dt-min-width: min-content;
|
|
12
12
|
--d2l-dl-wrapper-dt-max-width: 10rem;
|
|
13
13
|
--d2l-dl-wrapper-dd-min-width: 50%;
|
|
14
14
|
}
|
|
15
|
-
dl {
|
|
15
|
+
d2l-dl-wrapper > dl {
|
|
16
16
|
align-items: baseline;
|
|
17
17
|
display: var(--d2l-dl-wrapper-dl-display, grid);
|
|
18
18
|
gap: 0.3rem 1.5rem;
|
|
19
19
|
grid-auto-flow: row;
|
|
20
20
|
grid-template-columns: minmax(var(--d2l-dl-wrapper-dt-min-width), auto) minmax(var(--d2l-dl-wrapper-dd-min-width), 1fr);
|
|
21
21
|
}
|
|
22
|
-
dt {
|
|
22
|
+
d2l-dl-wrapper > dl > dt {
|
|
23
23
|
margin: var(--d2l-dl-wrapper-dt-margin, 0);
|
|
24
24
|
max-width: var(--d2l-dl-wrapper-dt-max-width);
|
|
25
25
|
}
|
|
26
|
-
dd {
|
|
26
|
+
d2l-dl-wrapper > dl > dd {
|
|
27
27
|
margin: var(--d2l-dl-wrapper-dd-margin, 0);
|
|
28
28
|
}
|
|
29
29
|
`,
|
|
@@ -2,7 +2,7 @@ import '../colors/colors.js';
|
|
|
2
2
|
import { css, unsafeCSS } from 'lit';
|
|
3
3
|
|
|
4
4
|
export const _isValidCssSelector = (selector) => {
|
|
5
|
-
const re = /
|
|
5
|
+
const re = /([a-zA-Z0-9-_ >.#]+)(\[[a-zA-Z0-9-_]+\])?([a-zA-Z0-9-_ >.#]+)?/g;
|
|
6
6
|
const match = selector.match(re);
|
|
7
7
|
|
|
8
8
|
return !!match && match.length === 1 && match[0].length === selector.length;
|
package/helpers/README.md
CHANGED
|
@@ -127,7 +127,7 @@ forceFocusVisible(node);
|
|
|
127
127
|
getComposedActiveElement()
|
|
128
128
|
|
|
129
129
|
// gets the first focusable descendant given a node, including those within the shadow DOM
|
|
130
|
-
getFirstFocusableDescendant(node, includeHidden, predicate)
|
|
130
|
+
getFirstFocusableDescendant(node, includeHidden, predicate, includeTabbablesOnly)
|
|
131
131
|
|
|
132
132
|
// gets the last focusable descendant given a node, including those within the shadow DOM
|
|
133
133
|
getLastFocusableDescendant(node, includeHidden)
|
package/helpers/focus.js
CHANGED
|
@@ -37,15 +37,15 @@ export function getComposedActiveElement() {
|
|
|
37
37
|
return node;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export function getFirstFocusableDescendant(node, includeHidden, predicate) {
|
|
40
|
+
export function getFirstFocusableDescendant(node, includeHidden, predicate, includeTabbablesOnly) {
|
|
41
41
|
if (predicate === undefined) predicate = () => true;
|
|
42
42
|
|
|
43
43
|
const composedChildren = getComposedChildren(node);
|
|
44
44
|
|
|
45
45
|
for (let i = 0; i < composedChildren.length; i++) {
|
|
46
|
-
if (isFocusable(composedChildren[i], includeHidden) && predicate(composedChildren[i])) return composedChildren[i];
|
|
46
|
+
if (isFocusable(composedChildren[i], includeHidden, includeTabbablesOnly) && predicate(composedChildren[i])) return composedChildren[i];
|
|
47
47
|
|
|
48
|
-
const focusable = getFirstFocusableDescendant(composedChildren[i], includeHidden, predicate);
|
|
48
|
+
const focusable = getFirstFocusableDescendant(composedChildren[i], includeHidden, predicate, includeTabbablesOnly);
|
|
49
49
|
if (focusable) return focusable;
|
|
50
50
|
}
|
|
51
51
|
|
package/helpers/prism.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
2
|
|
|
3
|
-
window.Prism = window.Prism || {};
|
|
4
|
-
Prism.manual = true;
|
|
5
|
-
|
|
6
3
|
const prismLocation = 'https://s.brightspace.com/lib/prismjs/1.28.0';
|
|
7
4
|
//const prismLocation = '/node_modules/prismjs'; // for local debugging
|
|
8
5
|
|
|
@@ -407,6 +404,12 @@ let prismLoaded;
|
|
|
407
404
|
const loadPrism = () => {
|
|
408
405
|
if (prismLoaded) return prismLoaded;
|
|
409
406
|
|
|
407
|
+
// Set Prism to manual mode before loading to make sure
|
|
408
|
+
// we don't automatically highlight before we finish
|
|
409
|
+
// configuring it.
|
|
410
|
+
window.Prism = window.Prism || {};
|
|
411
|
+
Prism.manual = true;
|
|
412
|
+
|
|
410
413
|
prismLoaded = Promise.all([
|
|
411
414
|
new Promise(resolve => {
|
|
412
415
|
const script = document.createElement('script');
|
package/lang/ar.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "المزيد",
|
|
93
93
|
"components.overflow-group.moreActions": "مزيد من الإجراءات",
|
|
94
94
|
"components.pager-load-more.action": "تحميل {count} إضافي",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} من أصل {totalCountFormatted} من العناصر} other {{showingCount} من أصل {totalCountFormatted} من العناصر}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "تحميل المزيد من المواد",
|
|
97
97
|
"components.selection.action-hint": "حدد مادة لتنفيذ هذا الإجراء.",
|
|
98
98
|
"components.selection.select-all": "تحديد الكل",
|
package/lang/da.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "flere",
|
|
93
93
|
"components.overflow-group.moreActions": "Flere handlinger",
|
|
94
94
|
"components.pager-load-more.action": "Indlæs {count} mere",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} af {totalCountFormatted} element} other {{showingCount} af {totalCountFormatted} elementer}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Indlæser flere elementer",
|
|
97
97
|
"components.selection.action-hint": "Vælg et element for at udføre denne handling.",
|
|
98
98
|
"components.selection.select-all": "Vælg alle",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.47.
|
|
3
|
+
"version": "2.47.5",
|
|
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",
|