@brightspace-ui/core 3.53.0 → 3.55.0
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/meter/README.md +5 -2
- package/components/meter/demo/meter.html +2 -1
- package/components/meter/meter-linear.js +3 -1
- package/components/meter/meter-radial.js +3 -1
- package/components/tabs/README.md +7 -0
- package/components/tabs/tab-panel-mixin.js +1 -1
- package/custom-elements.json +2 -2
- package/package.json +1 -1
@@ -56,12 +56,14 @@ Linear meters show a horizontal progress bar.
|
|
56
56
|
|
57
57
|
* `value` (required, Number): Current number of completed units. A positive, non-zero number that is less than or equal to `max`.
|
58
58
|
* `max` (Number, default: `100`): Max number of units that are being measured by this meter. A positive, non-zero number.
|
59
|
-
* `percent` Boolean: Shows a percentage instead of `value/max`.
|
60
|
-
* `text-inline` Boolean: Keeps the meter to a single line.
|
59
|
+
* `percent` (Boolean): Shows a percentage instead of `value/max`.
|
60
|
+
* `text-inline` (Boolean): Keeps the meter to a single line.
|
61
|
+
* `text` (String): Context information about what the meter is about. Adding one of the following between `{}` (e.g., `{x/y}`) causes replacements:
|
61
62
|
* `%` in the string will be replaced with percentage value
|
62
63
|
* `x/y` in the string will be replaced with fraction with the proper language support
|
63
64
|
* **DEPRECATED** `x` in the string will be replaced with `value`
|
64
65
|
* **DEPRECATED** `y` in the string will be replaced with `max`
|
66
|
+
* `text-hidden` (Boolean): Hides the text visually
|
65
67
|
<!-- docs: end hidden content -->
|
66
68
|
|
67
69
|
## Radial meter [d2l-meter-radial]
|
@@ -85,6 +87,7 @@ Radial meters appear as a half circle. They have more visual weight than a line
|
|
85
87
|
* `text` (String): Context information about what the meter is about. Adding one of the following between `{}` (e.g., `{x/y}`) causes replacements:
|
86
88
|
* `%` in the string will be replaced with percentage value
|
87
89
|
* `x/y` in the string will be replaced with fraction with the proper language support
|
90
|
+
* `text-hidden` (Boolean): Hides the text visually
|
88
91
|
<!-- docs: end hidden content -->
|
89
92
|
|
90
93
|
|
@@ -42,6 +42,7 @@
|
|
42
42
|
<d2l-meter-linear value="3" max="6"></d2l-meter-linear>
|
43
43
|
<d2l-meter-linear value="3" max="6" percent></d2l-meter-linear>
|
44
44
|
<d2l-meter-linear value="3" max="6" text="Visited: {x/y}" percent></d2l-meter-linear>
|
45
|
+
<d2l-meter-linear value="3" max="6" text="Visited: {x/y}" percent text-hidden></d2l-meter-linear>
|
45
46
|
<d2l-meter-linear value="3" max="6" text="Visited: {%}"></d2l-meter-linear>
|
46
47
|
<d2l-meter-linear value="3" max="6" text="You're doing great!" percent></d2l-meter-linear>
|
47
48
|
</div>
|
@@ -74,7 +75,7 @@
|
|
74
75
|
<div class="dark-background">
|
75
76
|
<d2l-meter-radial value="0" max="10" foreground-light></d2l-meter-radial>
|
76
77
|
<d2l-meter-radial value="5" max="13" foreground-light></d2l-meter-radial>
|
77
|
-
<d2l-meter-radial value="5" max="13" percent foreground-light></d2l-meter-radial>
|
78
|
+
<d2l-meter-radial value="5" max="13" percent foreground-light text="Made some progress" text-hidden></d2l-meter-radial>
|
78
79
|
<d2l-meter-radial value="10" max="10" foreground-light></d2l-meter-radial>
|
79
80
|
<d2l-meter-radial value="5" max="10" text="Completed" foreground-light></d2l-meter-radial>
|
80
81
|
<d2l-meter-radial value="19" max="26" style="width: 25%;" foreground-light></d2l-meter-radial>
|
@@ -115,7 +115,9 @@ class MeterLinear extends MeterMixin(RtlMixin(LitElement)) {
|
|
115
115
|
'd2l-meter-linear-primary-ltr': !this.percent,
|
116
116
|
'd2l-meter-linear-primary': true
|
117
117
|
};
|
118
|
-
const secondaryTextElement = secondary
|
118
|
+
const secondaryTextElement = secondary && !this.textHidden
|
119
|
+
? html`<div class="d2l-meter-linear-secondary">${secondary}</div>`
|
120
|
+
: nothing;
|
119
121
|
|
120
122
|
return html `
|
121
123
|
<div
|
@@ -32,7 +32,9 @@ class MeterRadial extends MeterMixin(RtlMixin(LitElement)) {
|
|
32
32
|
const secondary = this._secondary(this.value, this.max, this.text);
|
33
33
|
const primaryAria = this._primary(this.value, this.max, true) || '';
|
34
34
|
const secondaryAria = this._secondary(this.value, this.max, this.text, true) || '';
|
35
|
-
const secondaryTextElement = this.text
|
35
|
+
const secondaryTextElement = this.text && !this.textHidden
|
36
|
+
? html`<div class="d2l-body-small d2l-meter-text">${secondary}</div>`
|
37
|
+
: nothing;
|
36
38
|
const textClasses = {
|
37
39
|
'd2l-meter-text-ltr': !this.percent,
|
38
40
|
'd2l-heading-4': true,
|
@@ -100,3 +100,10 @@ Selecting a tab in the tab bar causes the relevant tab panel to be displayed. Ta
|
|
100
100
|
### Events
|
101
101
|
- `d2l-tab-panel-selected`: dispatched when a tab is selected
|
102
102
|
<!-- docs: end hidden content -->
|
103
|
+
|
104
|
+
## Accessibility
|
105
|
+
|
106
|
+
The `tabs` components were built following [W3C best practices for Tabs](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/) with Manual Activation. Important features include:
|
107
|
+
- Following recommended keyboard control patterns (with the exception of the "Optional" Home, End, and Delete key patterns)
|
108
|
+
- Using the roles of `tablist` and `tab` appropriately in order to facilitate screen reader information (e.g., "tab, 2 of 7")
|
109
|
+
- Using `aria-selected` to indicate `tab` selection state
|
@@ -21,7 +21,7 @@ export const TabPanelMixin = superclass => class extends superclass {
|
|
21
21
|
*/
|
22
22
|
selected: { type: Boolean, reflect: true },
|
23
23
|
/**
|
24
|
-
* REQUIRED: The text used for the tab, as well as labelling the panel
|
24
|
+
* ACCESSIBILITY: REQUIRED: The text used for the tab, as well as labelling the panel
|
25
25
|
* @type {string}
|
26
26
|
*/
|
27
27
|
text: { type: String }
|
package/custom-elements.json
CHANGED
@@ -12586,7 +12586,7 @@
|
|
12586
12586
|
"attributes": [
|
12587
12587
|
{
|
12588
12588
|
"name": "text",
|
12589
|
-
"description": "REQUIRED: The text used for the tab, as well as labelling the panel",
|
12589
|
+
"description": "ACCESSIBILITY: REQUIRED: The text used for the tab, as well as labelling the panel",
|
12590
12590
|
"type": "string"
|
12591
12591
|
},
|
12592
12592
|
{
|
@@ -12606,7 +12606,7 @@
|
|
12606
12606
|
{
|
12607
12607
|
"name": "text",
|
12608
12608
|
"attribute": "text",
|
12609
|
-
"description": "REQUIRED: The text used for the tab, as well as labelling the panel",
|
12609
|
+
"description": "ACCESSIBILITY: REQUIRED: The text used for the tab, as well as labelling the panel",
|
12610
12610
|
"type": "string"
|
12611
12611
|
},
|
12612
12612
|
{
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.55.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",
|