@brightspace-ui/core 2.26.0 → 2.26.3

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.
@@ -27,6 +27,7 @@ export const radioStyles = css`
27
27
  }
28
28
  .d2l-input-radio,
29
29
  .d2l-input-radio:hover:disabled,
30
+ .d2l-input-radio:hover.d2l-disabled,
30
31
  .d2l-input-radio-label > input[type="radio"],
31
32
  .d2l-input-radio-label > input[type="radio"]:hover:disabled {
32
33
  background-color: var(--d2l-color-regolith);
@@ -283,43 +283,30 @@ Nested menus can be defined by placing a `d2l-menu` inside a `d2l-menu-item`. F
283
283
  ![Nested Menu](./screenshots/nested-menu.png?raw=true)
284
284
  <!-- docs: end hidden content -->
285
285
 
286
- <!-- docs: demo -->
286
+ <!-- docs: demo code -->
287
287
  ```html
288
288
  <script type="module">
289
289
  import '@brightspace-ui/core/components/menu/menu.js';
290
290
  import '@brightspace-ui/core/components/menu/menu-item.js';
291
- import '@brightspace-ui/core/components/menu/menu-item-separator.js';
292
291
  </script>
293
292
 
294
293
  <d2l-menu label="Astronomy">
295
- <d2l-menu-item text="Introduction"></d2l-menu-item>
296
- <d2l-menu-item-separator></d2l-menu-item-separator>
297
- <d2l-menu-item text="Searching the Heavens"></d2l-menu-item>
298
294
  <d2l-menu-item text="The Solar System">
299
295
  <d2l-menu>
300
- <d2l-menu-item text="Formation"></d2l-menu-item>
301
- <d2l-menu-item text="Modern Solar System"></d2l-menu-item>
296
+ <d2l-menu-item text="The Sun"></d2l-menu-item>
302
297
  <d2l-menu-item text="The Planets">
303
298
  <d2l-menu>
304
299
  <d2l-menu-item text="Mercury"></d2l-menu-item>
305
300
  <d2l-menu-item text="Venus"></d2l-menu-item>
306
301
  <d2l-menu-item text="Earth"></d2l-menu-item>
307
- <d2l-menu-item text="Mars"></d2l-menu-item>
308
- <d2l-menu-item text="..."></d2l-menu-item>
309
302
  </d2l-menu>
310
303
  </d2l-menu-item>
311
- <d2l-menu-item text="The Sun"></d2l-menu-item>
312
- <d2l-menu-item text="Asteroids"></d2l-menu-item>
313
304
  <d2l-menu-item text="Comets"></d2l-menu-item>
314
305
  </d2l-menu>
315
306
  </d2l-menu-item>
316
307
  <d2l-menu-item text="Stars &amp; Galaxies">
317
308
  <d2l-menu>
318
- <d2l-menu-item text="What is a Star?"></d2l-menu-item>
319
309
  <d2l-menu-item text="Lifecycle of a Star"></d2l-menu-item>
320
- <d2l-menu-item text="Binaries &amp; Multiples"></d2l-menu-item>
321
- <d2l-menu-item text="Star Clusters"></d2l-menu-item>
322
- <d2l-menu-item text="Star Death"></d2l-menu-item>
323
310
  <d2l-menu-item text="Galaxies"></d2l-menu-item>
324
311
  </d2l-menu>
325
312
  </d2l-menu-item>
@@ -1,4 +1,6 @@
1
- export const MenuItemMixin = superclass => class extends superclass {
1
+ import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
2
+
3
+ export const MenuItemMixin = superclass => class extends FocusVisiblePolyfillMixin(superclass) {
2
4
 
3
5
  static get properties() {
4
6
  return {
@@ -16,8 +16,8 @@ export const menuItemStyles = css`
16
16
  width: 100%;
17
17
  }
18
18
 
19
- :host(:focus),
20
- :host([first]:focus),
19
+ :host(.focus-visible),
20
+ :host([first].focus-visible),
21
21
  :host(:hover),
22
22
  :host([first]:hover) {
23
23
  background-color: var(--d2l-menu-background-color-hover);
@@ -27,17 +27,7 @@ export const menuItemStyles = css`
27
27
  z-index: 2;
28
28
  }
29
29
 
30
- /** separated because safari is having trouble parsing these */
31
- :host(:focus-visible),
32
- :host(:focus-visible[first]) {
33
- background-color: var(--d2l-menu-background-color-hover);
34
- border-bottom: 1px solid var(--d2l-menu-border-color-hover);
35
- border-top: 1px solid var(--d2l-menu-border-color-hover);
36
- color: var(--d2l-menu-foreground-color-hover);
37
- z-index: 2;
38
- }
39
-
40
- :host([disabled]), :host([disabled]:hover), :host([disabled]:focus-visible) {
30
+ :host([disabled]), :host([disabled]:hover), :host([disabled].focus-visible) {
41
31
  cursor: default;
42
32
  opacity: 0.75;
43
33
  }
@@ -50,12 +40,7 @@ export const menuItemStyles = css`
50
40
  border-top-color: transparent;
51
41
  }
52
42
 
53
- :host([last]:hover) {
54
- border-bottom-color: var(--d2l-menu-border-color-hover);
55
- }
56
-
57
- /** separated because safari is having trouble parsing these */
58
- :host([last]:focus-visible) {
43
+ :host([last]:hover), :host([last].focus-visible) {
59
44
  border-bottom-color: var(--d2l-menu-border-color-hover);
60
45
  }
61
46
 
@@ -2,6 +2,7 @@ import '../colors/colors.js';
2
2
  import '../icons/icon.js';
3
3
  import './menu-item-return.js';
4
4
  import { css, html, LitElement } from 'lit';
5
+ import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
5
6
  import { HierarchicalViewMixin } from '../hierarchical-view/hierarchical-view-mixin.js';
6
7
  import { ThemeMixin } from '../../mixins/theme-mixin.js';
7
8
 
@@ -20,7 +21,7 @@ const keyCodes = {
20
21
  * @slot - Menu items
21
22
  * @fires d2l-menu-resize - Dispatched when size of menu changes (e.g., when nested menu of a different size is opened)
22
23
  */
23
- class Menu extends ThemeMixin(HierarchicalViewMixin(LitElement)) {
24
+ class Menu extends FocusVisiblePolyfillMixin(ThemeMixin(HierarchicalViewMixin(LitElement))) {
24
25
 
25
26
  static get properties() {
26
27
  return {
@@ -154,6 +154,7 @@ class Input extends SkeletonMixin(LabelledMixin(LitElement)) {
154
154
 
155
155
  _handleRadioClick(e) {
156
156
  e.stopPropagation();
157
+ if (this.disabled) return;
157
158
  this.selected = true;
158
159
  }
159
160
 
@@ -147,7 +147,8 @@ export const SelectionMixin = superclass => class extends RtlMixin(superclass) {
147
147
  if (!e.composedPath()[0].classList.contains('d2l-selection-input-radio')) return;
148
148
  if (e.keyCode < keyCodes.LEFT || e.keyCode > keyCodes.DOWN) return;
149
149
 
150
- const selectables = Array.from(this._selectionSelectables.values());
150
+ const selectables = Array.from(this._selectionSelectables.values())
151
+ .filter(item => !item.disabled);
151
152
  let currentIndex = selectables.findIndex(selectable => selectable.selected);
152
153
  if (currentIndex === -1) currentIndex = 0;
153
154
  let newIndex;
@@ -172,17 +172,12 @@ The `d2l-tooltip-help` component is used to display additional information when
172
172
  <!-- docs: end donts -->
173
173
  <!-- docs: end best practices -->
174
174
 
175
- <!-- docs: demo code name:d2l-tooltip-help autoSize:false size:small -->
175
+ <!-- docs: demo live name:d2l-tooltip-help autoSize:false size:small -->
176
176
  ```html
177
177
  <script type="module">
178
178
  import '@brightspace-ui/core/components/tooltip/tooltip-help.js';
179
179
  </script>
180
180
 
181
- <d2l-tooltip-help text="Helpful label">Contents should elaborate on the label (be short and concise)</d2l-tooltip-help>
182
- <p class="d2l-body-small">
183
- This is some sample text.
184
- <d2l-tooltip-help text="Helpful label" inherit-font-style>Contents should elaborate on the label (be short and concise)</d2l-tooltip-help>
185
- </p>
186
181
  <p class="d2l-body-compact">
187
182
  This is some sample text.
188
183
  <d2l-tooltip-help text="Helpful label" inherit-font-style>Contents should elaborate on the label (be short and concise)</d2l-tooltip-help>
@@ -201,9 +196,9 @@ The `d2l-tooltip-help` component is used to display additional information when
201
196
  ### Using in a Sentence or Paragraph
202
197
 
203
198
  When placing a help tooltip next to other text as part of a sentence or a paragraph, use `inherit-font-style` to align its style with the adjacent text
204
- (see 2nd and 3rd examples above).
199
+ (see the demo example above).
205
200
 
206
201
  Note that the help tooltip does not support being used *within* a language term, due to challenges with translation.
207
202
  Instead, your opener text will need to be a separate language term appearing before or after the other text and making sense on its own.
208
203
 
209
- See the [Visibility Switch](https://daylight.d2l.dev/components/switch/#d2l-switch-visibility) for an example.
204
+ See also the [Visibility Switch](https://daylight.d2l.dev/components/switch/#d2l-switch-visibility) for an example use case.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.26.0",
3
+ "version": "2.26.3",
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",