@brightspace-ui/core 3.27.5 → 3.27.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,7 @@ import { cssEscape, getComposedChildren, getComposedParent, isVisible } from '..
|
|
4
4
|
|
5
5
|
const BACKDROP_HIDDEN = 'data-d2l-backdrop-hidden';
|
6
6
|
const BACKDROP_ARIA_HIDDEN = 'data-d2l-backdrop-aria-hidden';
|
7
|
+
const TRANSITION_DURATION = 200;
|
7
8
|
|
8
9
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
9
10
|
|
@@ -47,7 +48,7 @@ class Backdrop extends LitElement {
|
|
47
48
|
opacity: 0;
|
48
49
|
position: fixed;
|
49
50
|
top: 0;
|
50
|
-
transition: opacity
|
51
|
+
transition: opacity ${TRANSITION_DURATION}ms ease-in;
|
51
52
|
width: 0;
|
52
53
|
z-index: 999;
|
53
54
|
}
|
@@ -123,6 +124,7 @@ class Backdrop extends LitElement {
|
|
123
124
|
if (!reduceMotion && !this.noAnimateHide && isVisible(this)) {
|
124
125
|
this.addEventListener('transitionend', hide, { once: true });
|
125
126
|
this._state = 'hiding';
|
127
|
+
setTimeout(() => this._state === 'hiding' && hide(), TRANSITION_DURATION + 100);
|
126
128
|
} else {
|
127
129
|
hide();
|
128
130
|
}
|
@@ -55,8 +55,8 @@ For text searches use `<d2l-input-search>`, which wraps the native `<input type=
|
|
55
55
|
|
56
56
|
| Property | Type | Description |
|
57
57
|
|---|---|---|
|
58
|
-
| `label` | String, required |
|
59
|
-
| `description` | String | Additional information communicated
|
58
|
+
| `label` | String, required | Acts as the primary label for the input. Not visible. |
|
59
|
+
| `description` | String | Additional information communicated to screenreader users when they focus on the input |
|
60
60
|
| `disabled` | Boolean | Disables the input |
|
61
61
|
| `maxlength` | Number | Imposes an upper character limit |
|
62
62
|
| `no-clear` | Boolean | Prevents the "clear" button from appearing |
|
@@ -82,11 +82,11 @@ When the input is cleared, the same event will be fired with an empty value.
|
|
82
82
|
* `inline-help`: Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
|
83
83
|
<!-- docs: end hidden content -->
|
84
84
|
|
85
|
-
|
85
|
+
## Accessbility
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
87
|
+
- While the component does not have a visible label, the search icon clearly indicates its purpose
|
88
|
+
- While not required to meet WCAG, this [pattern](https://www.w3.org/WAI/WCAG2/supplemental/patterns/o1p07-icons-used/) is a great way to help individuals with cognitive accessibility needs
|
89
|
+
- The contrast ratio of the placeholder text can be safely ignored since the search icon serves the same purpose, and meets that criteria
|
90
|
+
- It is important to note that `placeholder` is not a suitable replacement for `label` or `description`, since it only applies when the input is empty, and not all users will be able to read it in the first place
|
91
|
+
- Search results should be announced to screen reader users using a live region around the result summary or by using the [`announce`](https://github.com/BrightspaceUI/core/blob/main/helpers/announce.js) helper
|
92
|
+
- It can also be used to help confirm what exactly was searched, along with how many results were found
|
@@ -21,7 +21,7 @@ class InputSearch extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement)))
|
|
21
21
|
static get properties() {
|
22
22
|
return {
|
23
23
|
/**
|
24
|
-
* Additional information communicated
|
24
|
+
* ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input
|
25
25
|
* @type {string}
|
26
26
|
*/
|
27
27
|
description: { type: String, reflect: true },
|
@@ -31,7 +31,7 @@ class InputSearch extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement)))
|
|
31
31
|
*/
|
32
32
|
disabled: { type: Boolean },
|
33
33
|
/**
|
34
|
-
* REQUIRED:
|
34
|
+
* ACCESSIBILITY: REQUIRED: Acts as the primary label for the input. Not visible.
|
35
35
|
* @type {string}
|
36
36
|
*/
|
37
37
|
label: { type: String },
|
package/custom-elements.json
CHANGED
@@ -6746,12 +6746,12 @@
|
|
6746
6746
|
"attributes": [
|
6747
6747
|
{
|
6748
6748
|
"name": "description",
|
6749
|
-
"description": "Additional information communicated
|
6749
|
+
"description": "ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input",
|
6750
6750
|
"type": "string"
|
6751
6751
|
},
|
6752
6752
|
{
|
6753
6753
|
"name": "label",
|
6754
|
-
"description": "REQUIRED:
|
6754
|
+
"description": "ACCESSIBILITY: REQUIRED: Acts as the primary label for the input. Not visible.",
|
6755
6755
|
"type": "string"
|
6756
6756
|
},
|
6757
6757
|
{
|
@@ -6793,13 +6793,13 @@
|
|
6793
6793
|
{
|
6794
6794
|
"name": "description",
|
6795
6795
|
"attribute": "description",
|
6796
|
-
"description": "Additional information communicated
|
6796
|
+
"description": "ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input",
|
6797
6797
|
"type": "string"
|
6798
6798
|
},
|
6799
6799
|
{
|
6800
6800
|
"name": "label",
|
6801
6801
|
"attribute": "label",
|
6802
|
-
"description": "REQUIRED:
|
6802
|
+
"description": "ACCESSIBILITY: REQUIRED: Acts as the primary label for the input. Not visible.",
|
6803
6803
|
"type": "string"
|
6804
6804
|
},
|
6805
6805
|
{
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.27.
|
3
|
+
"version": "3.27.7",
|
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",
|