@brightspace-ui/core 2.59.1 → 2.59.2

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.
@@ -3,7 +3,9 @@ import { css, html, LitElement } from 'lit';
3
3
  import { cssEscape, getComposedChildren, getComposedParent, isVisible } from '../../helpers/dom.js';
4
4
  import { getUniqueId } from '../../helpers/uniqueId.js';
5
5
 
6
- export const BACKDROP_ROLE = 'd2l-backdrop-role';
6
+ export const BACKDROP_ROLE = 'data-d2l-backdrop-role';
7
+ const BACKDROP_HIDDEN = 'data-d2l-backdrop-hidden';
8
+ const BACKDROP_ARIA_HIDDEN = 'data-d2l-backdrop-aria-hidden';
7
9
 
8
10
  const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
9
11
 
@@ -158,7 +160,7 @@ function hideAccessible(target) {
158
160
 
159
161
  if (child.tagName === 'SCRIPT' || child.tagName === 'STYLE') continue;
160
162
  if (path.indexOf(child) !== -1) continue;
161
- if (child.hasAttribute('d2l-backdrop-hidden')) continue;
163
+ if (child.hasAttribute(BACKDROP_HIDDEN)) continue;
162
164
 
163
165
  const role = child.getAttribute('role');
164
166
  if (role) child.setAttribute(BACKDROP_ROLE, role);
@@ -166,11 +168,11 @@ function hideAccessible(target) {
166
168
 
167
169
  if (child.nodeName === 'FORM' || child.nodeName === 'A') {
168
170
  const ariaHidden = child.getAttribute('aria-hidden');
169
- if (ariaHidden) child.setAttribute('d2l-backdrop-aria-hidden', ariaHidden);
171
+ if (ariaHidden) child.setAttribute(BACKDROP_ARIA_HIDDEN, ariaHidden);
170
172
  child.setAttribute('aria-hidden', 'true');
171
173
  }
172
174
 
173
- child.setAttribute('d2l-backdrop-hidden', 'd2l-backdrop-hidden');
175
+ child.setAttribute(BACKDROP_HIDDEN, BACKDROP_HIDDEN);
174
176
  hiddenElements.push(child);
175
177
 
176
178
  hideAccessibleChildren(child);
@@ -209,14 +211,16 @@ function showAccessible(elems) {
209
211
  } else {
210
212
  elem.removeAttribute('role');
211
213
  }
212
- const ariaHidden = elem.getAttribute('d2l-backdrop-aria-hidden');
213
- if (ariaHidden) {
214
- elem.setAttribute('aria-hidden', ariaHidden);
215
- elem.removeAttribute('d2l-backdrop-aria-hidden');
216
- } else {
217
- elem.removeAttribute('aria-hidden');
214
+ if (elem.nodeName === 'FORM' || elem.nodeName === 'A') {
215
+ const ariaHidden = elem.getAttribute(BACKDROP_ARIA_HIDDEN);
216
+ if (ariaHidden) {
217
+ elem.setAttribute('aria-hidden', ariaHidden);
218
+ elem.removeAttribute(BACKDROP_ARIA_HIDDEN);
219
+ } else {
220
+ elem.removeAttribute('aria-hidden');
221
+ }
218
222
  }
219
- elem.removeAttribute('d2l-backdrop-hidden');
223
+ elem.removeAttribute(BACKDROP_HIDDEN);
220
224
  }
221
225
  }
222
226
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.59.1",
3
+ "version": "2.59.2",
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",