@brightspace-ui/core 1.219.1 → 1.219.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.
@@ -116,11 +116,27 @@ a pop-up at the bottom of the screen that automatically dismisses itself by defa
116
116
  <!-- docs: demo live name:d2l-alert-toast autoSize:false -->
117
117
  ```html
118
118
  <script type="module">
119
- import '@brightspace-ui/core/components/alert/alert-toast.js';
119
+ import '@brightspace-ui/core/components/alert/alert-toast.js';
120
+ import '@brightspace-ui/core/components/button/button.js';
120
121
  </script>
122
+ <!-- docs: start hidden content -->
123
+ <script type="module">
124
+ var alertToast = document.querySelector('d2l-alert-toast');
125
+ var button = document.querySelector('#open');
126
+
127
+ alertToast.addEventListener('d2l-alert-toast-close', function() {
128
+ button.style.display = 'block';
129
+ });
121
130
 
131
+ button.addEventListener('click', () => {
132
+ alertToast.open = true;
133
+ button.style.display = 'none';
134
+ });
135
+ </script>
136
+ <d2l-button id="open" style="align-self:center;display:none;">Show Alert</d2l-button>
137
+ <!-- docs: end hidden content -->
122
138
  <d2l-alert-toast type="default" no-auto-close open>
123
- A default toast alert.
139
+ A default toast alert.
124
140
  </d2l-alert-toast>
125
141
  ```
126
142
 
@@ -141,7 +141,7 @@ Alternately, add the `compact` attribute to only display the last breadcrumb. Th
141
141
  To make your usage of `d2l-breadcrumb` (child) accessible, use the following attribute when applicable:
142
142
 
143
143
  | Attribute | Description |
144
- |--|--|
144
+ |---|---|
145
145
  | `aria-label` | Acts as a primary label. Use if `text` does not provide enough context. |
146
146
 
147
147
  ## Current Page [d2l-breadcrumb-current-page]
@@ -62,7 +62,7 @@ The `d2l-button` element can be used just like the native button element, but al
62
62
  To make your `d2l-button` accessible, use the following properties when applicable:
63
63
 
64
64
  | Attribute | Description |
65
- |--|--|
65
+ |---|---|
66
66
  | `aria-expanded` | [Indicate expansion state of a collapsible element](https://www.w3.org/WAI/PF/aria/states_and_properties#aria-expanded). Example: [d2l-more-less](https://github.com/BrightspaceUI/core/blob/f9f30d0975ee5a8479263a84541fc3b781e8830f/components/more-less/more-less.js#L158). |
67
67
  | `aria-haspopup` | [Indicate clicking the button opens a menu](https://www.w3.org/WAI/PF/aria/states_and_properties#aria-haspopup). Example: [d2l-dropdown](https://github.com/BrightspaceUI/core/blob/main/components/dropdown/dropdown-opener-mixin.js#L46). |
68
68
  | `description` | Use when text on button does not provide enough context. |
@@ -104,7 +104,7 @@ The `d2l-button-subtle` element can be used just like the native `button`, but f
104
104
  To make your `d2l-button-subtle` accessible, use the following properties when applicable:
105
105
 
106
106
  | Attribute | Description |
107
- |--|--|
107
+ |---|---|
108
108
  | `aria-expanded` | [Indicate expansion state of a collapsible element](https://www.w3.org/WAI/PF/aria/states_and_properties#aria-expanded). Example: [d2l-more-less](https://github.com/BrightspaceUI/core/blob/f9f30d0975ee5a8479263a84541fc3b781e8830f/components/more-less/more-less.js#L158). |
109
109
  | `aria-haspopup` | [Indicate clicking the button opens a menu](https://www.w3.org/WAI/PF/aria/states_and_properties#aria-haspopup). Example: [d2l-dropdown](https://github.com/BrightspaceUI/core/blob/main/components/dropdown/dropdown-opener-mixin.js#L46). |
110
110
  | `description` | Use when text on button does not provide enough context. |
@@ -143,7 +143,7 @@ The `d2l-button-icon` element can be used just like the native `button`, for ins
143
143
  To make your `d2l-button-icon` accessible, use the following properties when applicable:
144
144
 
145
145
  | Attribute | Description |
146
- |--|--|
146
+ |---|---|
147
147
  | `text` | **REQUIRED**. Acts as a primary label and tooltip. |
148
148
  | `aria-expanded` | [Indicate expansion state of a collapsible element](https://www.w3.org/WAI/PF/aria/states_and_properties#aria-expanded). Example: [d2l-more-less](https://github.com/BrightspaceUI/core/blob/f9f30d0975ee5a8479263a84541fc3b781e8830f/components/more-less/more-less.js#L158). |
149
149
  | `aria-haspopup` | [Indicate clicking the button opens a menu](https://www.w3.org/WAI/PF/aria/states_and_properties#aria-haspopup). Example: [d2l-dropdown](https://github.com/BrightspaceUI/core/blob/main/components/dropdown/dropdown-opener-mixin.js#L46). |
@@ -225,14 +225,17 @@ class HtmlBlock extends LitElement {
225
225
 
226
226
  async _processRenderers(elem) {
227
227
  for (const renderer of getRenderers()) {
228
- if (this.noDeferredRendering && !renderer.canRenderInline) continue;
229
-
230
228
  if (this._contextObserverController && renderer.contextAttributes) {
231
229
  const contextValues = new Map();
232
230
  renderer.contextAttributes.forEach(attr => contextValues.set(attr, this._contextObserverController.values.get(attr)));
233
- elem = await renderer.render(elem, contextValues);
231
+ elem = await renderer.render(elem, {
232
+ contextValues: contextValues,
233
+ noDeferredRendering: this.noDeferredRendering
234
+ });
234
235
  } else {
235
- elem = await renderer.render(elem);
236
+ elem = await renderer.render(elem, {
237
+ noDeferredRendering: this.noDeferredRendering
238
+ });
236
239
  }
237
240
  }
238
241
 
@@ -189,7 +189,7 @@ To make your usage of `d2l-input-time` accessible, use the following properties
189
189
  |--|--|
190
190
  | `label` | **REQUIRED** [Acts as a primary label on the input](https://www.w3.org/WAI/tutorials/forms/labels/). Visible unless `label-hidden` is also used. |
191
191
  | `label-hidden` | Use if label should be visually hidden but available for screen reader users |
192
- | `labelled-by` | String | Use when another visible element should act as the label |
192
+ | `labelled-by` | Use when another visible element should act as the label |
193
193
 
194
194
  ## Time Range Input [d2l-input-time-range]
195
195
 
@@ -84,7 +84,7 @@ To make your usage of `d2l-input-number` accessible, use the following propertie
84
84
  |---|---|
85
85
  | `label` | **REQUIRED.** [Acts as a primary label on the input](https://www.w3.org/WAI/tutorials/forms/labels/). Visible unless `label-hidden` is also used. |
86
86
  | `label-hidden` | Use if label should be visually hidden but available for screen reader users. |
87
- | `labelled-by` | String | Use when another visible element should act as the label |
87
+ | `labelled-by` | Use when another visible element should act as the label |
88
88
  | `unit` | Use to render the unit (offscreen) as part of the label. |
89
89
  | `title` | Use for additional screen reader and mouseover context. |
90
90
 
@@ -138,7 +138,7 @@ To make your usage of `d2l-input-text` accessible, use the following properties
138
138
  | `description` | Use when label on input does not provide enough context. |
139
139
  | `label` | **REQUIRED** [Acts as a primary label on the input](https://www.w3.org/WAI/tutorials/forms/labels/). Visible unless `label-hidden` is also used. |
140
140
  | `label-hidden` | Use if label should be visually hidden but available for screen reader users |
141
- | `labelled-by` | String | Use when another visible element should act as the label |
141
+ | `labelled-by` | Use when another visible element should act as the label |
142
142
  | `unit` | Use to render the unit (offscreen) as part of the label. |
143
143
  | `title` | Text for additional screen reader and mouseover context |
144
144
 
@@ -247,7 +247,7 @@ To make your usage of `d2l-input-textarea` accessible, use the following propert
247
247
  | `description` | Use when label on `textarea` does not provide enough context. |
248
248
  | `label` | **REQUIRED** [Acts as a primary label on the `textarea`](https://www.w3.org/WAI/tutorials/forms/labels/). Visible unless `label-hidden` is also used. |
249
249
  | `label-hidden` | Use if label should be visually hidden but available for screen reader users |
250
- | `labelled-by` | String | Use when another visible element should act as the label |
250
+ | `labelled-by` | Use when another visible element should act as the label |
251
251
 
252
252
  ### Methods
253
253
 
@@ -199,8 +199,9 @@ class InputCheckbox extends SkeletonMixin(RtlMixin(LitElement)) {
199
199
  name="${ifDefined(this.name)}"
200
200
  tabindex="${ifDefined(tabindex)}"
201
201
  type="checkbox"
202
- .value="${this.value}"></span><span class="${classMap(textClasses)}">${offscreenContainer}<slot></slot></span>
202
+ .value="${this.value}"></span><span class="${classMap(textClasses)}"><slot></slot></span>
203
203
  </label>
204
+ ${offscreenContainer}
204
205
  `;
205
206
  }
206
207
 
@@ -40,7 +40,7 @@ export const radioStyles = css`
40
40
  .d2l-input-radio-label > input[type="radio"]:focus {
41
41
  border-color: var(--d2l-color-celestine);
42
42
  border-width: 2px;
43
- outline-width: 0;
43
+ outline: none;
44
44
  }
45
45
  .d2l-input-radio[aria-invalid="true"],
46
46
  .d2l-input-radio-label > input[type="radio"][aria-invalid="true"] {
@@ -4,19 +4,13 @@ let mathJaxLoaded;
4
4
 
5
5
  export class HtmlBlockMathRenderer {
6
6
 
7
- get canRenderInline() {
8
- // The custom MathJax ShadowAdaptor creates a new document and renders
9
- // its contents to the DOM.
10
- return false;
11
- }
12
-
13
7
  get contextAttributes() {
14
8
  return [mathjaxContextAttribute];
15
9
  }
16
10
 
17
- async render(elem, contextValues) {
18
- if (!contextValues) return elem;
19
- const contextVal = contextValues.get(mathjaxContextAttribute);
11
+ async render(elem, options) {
12
+ if (!options.contextValues) return elem;
13
+ const contextVal = options.contextValues.get(mathjaxContextAttribute);
20
14
  if (contextVal === undefined) return elem;
21
15
 
22
16
  const context = JSON.parse(contextVal) || {};
@@ -31,6 +25,10 @@ export class HtmlBlockMathRenderer {
31
25
 
32
26
  await loadMathJax(mathJaxConfig);
33
27
 
28
+ // If we're opting out of deferred rendering, we need to rely
29
+ // on the global MathJax install for rendering.
30
+ if (options.noDeferredRendering) return elem;
31
+
34
32
  const temp = document.createElement('div');
35
33
  temp.style.display = 'none';
36
34
  temp.attachShadow({ mode: 'open' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.219.1",
3
+ "version": "1.219.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",