@brightspace-ui/core 3.26.0 → 3.26.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.
@@ -43,7 +43,7 @@ The `d2l-switch` element is a generic switch with on/off semantics.
|
|
43
43
|
|
44
44
|
| Property | Type | Description |
|
45
45
|
|---|---|---|
|
46
|
-
| `text` | String, required |
|
46
|
+
| `text` | String, required | Acts as the primary label for the switch. Visible unless text-position is `hidden`. |
|
47
47
|
| `disabled` | Boolean | Disables the switch |
|
48
48
|
| `on` | Boolean | Whether the switch is "on" or "off" |
|
49
49
|
| `text-position` | String | Valid values are: `start`, `end` (default), and `hidden` |
|
@@ -52,14 +52,6 @@ The `d2l-switch` element is a generic switch with on/off semantics.
|
|
52
52
|
- `change`: dispatched when the `on` property is updated
|
53
53
|
<!-- docs: end hidden content -->
|
54
54
|
|
55
|
-
### Accessibility Properties
|
56
|
-
|
57
|
-
To make your usage of `d2l-switch` accessible, use the following property:
|
58
|
-
|
59
|
-
| Attribute | Description |
|
60
|
-
|---|---|
|
61
|
-
| `text` | **REQUIRED** [Acts as a primary label on the switch](https://www.w3.org/WAI/tutorials/forms/labels/). Visible unless text-position is `hidden`. |
|
62
|
-
|
63
55
|
## Visibility Switch [d2l-switch-visibility]
|
64
56
|
|
65
57
|
The d2l-switch-visibility component is a special variant for toggling the visibility of activities. Activities can be set to "on" but still not appear for users due to availability conditions. Therefore, the d2l-switch-visibility can display as "Hidden", "Visible", or "Visible. Conditions must be met" if a description of the conditions is provided.
|
@@ -110,3 +102,8 @@ If an activity is set to `Visible` but also has other conditions affecting its v
|
|
110
102
|
</ul>
|
111
103
|
</d2l-switch-visibility>
|
112
104
|
```
|
105
|
+
|
106
|
+
## Accessbility
|
107
|
+
|
108
|
+
- When `text-position` is set to `hidden`, the required `text` will be used for the switch's hidden label so that it is [accessible](https://www.w3.org/WAI/WCAG22/quickref/#name-role-value) to non-sighted users.
|
109
|
+
- `d2l-switch-visibility` is a notable exception to the best practice of having a static term as the label; this was done to provide more clarity in situations where there are external conditions that could influence whether or not the content in question is visible.
|
@@ -6,7 +6,7 @@ import { SwitchMixin } from './switch-mixin.js';
|
|
6
6
|
|
7
7
|
/**
|
8
8
|
* A generic switch with on/off semantics.
|
9
|
-
* @attr {string} text - REQUIRED:
|
9
|
+
* @attr {string} text - ACCESSIBILITY: REQUIRED: Acts as the primary label for the switch. Visible unless text-position is `hidden`.
|
10
10
|
*/
|
11
11
|
class Switch extends SwitchMixin(LitElement) {
|
12
12
|
|
package/custom-elements.json
CHANGED
@@ -12117,7 +12117,7 @@
|
|
12117
12117
|
},
|
12118
12118
|
{
|
12119
12119
|
"name": "text",
|
12120
|
-
"description": "REQUIRED:
|
12120
|
+
"description": "ACCESSIBILITY: REQUIRED: Acts as the primary label for the switch. Visible unless text-position is `hidden`.",
|
12121
12121
|
"type": "string"
|
12122
12122
|
}
|
12123
12123
|
],
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.26.
|
3
|
+
"version": "3.26.1",
|
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",
|