@brightspace-ui/core 1.236.2 → 1.237.0

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.
@@ -84,6 +84,12 @@ class DialogFullscreen extends LocalizeCoreElement(AsyncContainerMixin(DialogMix
84
84
  width: auto;
85
85
  }
86
86
 
87
+ dialog.d2l-dialog-outer.d2l-dialog-fullscreen-within,
88
+ div.d2l-dialog-outer.d2l-dialog-fullscreen-within {
89
+ /* no margins when there is a fullscreen element within */
90
+ margin: 0;
91
+ }
92
+
87
93
  :host(:not([in-iframe])) dialog.d2l-dialog-outer,
88
94
  :host(:not([in-iframe])) div.d2l-dialog-outer {
89
95
  height: calc(100% - 3rem);
@@ -369,6 +369,12 @@ The `d2l-list-item` provides the appropriate `listitem` semantics for children w
369
369
  | `selected` | Boolean | Whether the item is selected |
370
370
  | `skeleton` | Boolean | Renders the input as a skeleton loader |
371
371
 
372
+ ### Methods
373
+
374
+ - `highlight()`: highlights the item
375
+ - `scrollToItem()`: scrolls to the item
376
+ - `scrollToAndHighlight()`: scrolls to the item and then highlights it
377
+
372
378
  ### Events
373
379
 
374
380
  - `d2l-list-item-link-click`: dispatched when the item's primary link action is clicked
@@ -77,6 +77,8 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
77
77
  _hoveringPrimaryAction: { type: Boolean },
78
78
  _focusing: { type: Boolean },
79
79
  _focusingPrimaryAction: { type: Boolean },
80
+ _highlight: { type: Boolean },
81
+ _highlighting: { type: Boolean },
80
82
  _tooltipShowing: { type: Boolean, attribute: '_tooltip-showing', reflect: true }
81
83
  };
82
84
  }
@@ -94,7 +96,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
94
96
  }
95
97
  :host([_tooltip-showing]),
96
98
  :host([_dropdown-open]) {
97
- z-index: 10;
99
+ z-index: 10; /* must be greater than adjacent selected items */
98
100
  }
99
101
  :host([_fullscreen-within]) {
100
102
  z-index: 1000; /* must be greater than floating workflow buttons */
@@ -282,14 +284,40 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
282
284
  border-color: #79b5df;
283
285
  }
284
286
  :host([selected]:not([disabled])) .d2l-list-item-active-border,
285
- :host([selected]:not([disabled])) d2l-list-item-generic-layout.d2l-focusing + .d2l-list-item-active-border {
286
- background: #79b5df;
287
+ :host([selected]:not([disabled])) d2l-list-item-generic-layout.d2l-focusing + .d2l-list-item-active-border,
288
+ :host(:not([disabled])) .d2l-list-item-highlight + .d2l-list-item-active-border {
289
+ background-color: #79b5df;
287
290
  bottom: 0;
288
291
  height: 1px;
289
292
  position: absolute;
290
293
  width: 100%;
291
294
  z-index: 5;
292
295
  }
296
+
297
+ .d2l-list-item-highlight {
298
+ transition: background-color 400ms linear, border-color 400ms linear;
299
+ }
300
+ .d2l-list-item-highlight + .d2l-list-item-active-border {
301
+ transition: background-color 400ms linear;
302
+ }
303
+ d2l-list-item-generic-layout.d2l-list-item-highlighting,
304
+ :host([selectable]:not([disabled]):not([skeleton])) d2l-list-item-generic-layout.d2l-list-item-highlighting.d2l-focusing,
305
+ :host([selectable]:not([disabled]):not([skeleton])) d2l-list-item-generic-layout.d2l-list-item-highlighting.d2l-hovering {
306
+ background-color: var(--d2l-color-celestine-plus-2);
307
+ border-color: var(--d2l-color-celestine);
308
+ }
309
+ :host(:not([disabled])) d2l-list-item-generic-layout.d2l-list-item-highlighting + .d2l-list-item-active-border {
310
+ background-color: var(--d2l-color-celestine);
311
+ }
312
+ :host([selected]:not([disabled])) d2l-list-item-generic-layout.d2l-list-item-highlighting {
313
+ background-color: var(--d2l-color-celestine-plus-2);
314
+ border-color: var(--d2l-color-celestine);
315
+ }
316
+ :host([selected]:not([disabled])) .d2l-list-item-highlighting + .d2l-list-item-active-border,
317
+ :host([selected]:not([disabled])) d2l-list-item-generic-layout.d2l-list-item-highlighting.d2l-focusing + .d2l-list-item-active-border {
318
+ background-color: var(--d2l-color-celestine);
319
+ }
320
+
293
321
  :host([_fullscreen-within]) .d2l-list-item-active-border,
294
322
  :host([_fullscreen-within]) d2l-list-item-generic-layout.d2l-focusing + .d2l-list-item-active-border {
295
323
  display: none;
@@ -365,6 +393,21 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
365
393
  if (node) node.focus();
366
394
  }
367
395
 
396
+ async highlight() {
397
+ if (this._highlight) return;
398
+ const elem = this.shadowRoot.querySelector('d2l-list-item-generic-layout');
399
+ this._highlight = true;
400
+ await this.updateComplete;
401
+ elem.addEventListener('transitionend', () => {
402
+ // more than one property is being animated so this rAF waits before wiring up the return phase listener
403
+ setTimeout(() => {
404
+ elem.addEventListener('transitionend', () => this._highlight = false, { once: true });
405
+ this._highlighting = false;
406
+ }, 1000);
407
+ }, { once: true });
408
+ this._highlighting = true;
409
+ }
410
+
368
411
  resizedCallback(width) {
369
412
  const lastBreakpointIndexToCheck = 3;
370
413
  this.breakpoints.some((breakpoint, index) => {
@@ -375,6 +418,19 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
375
418
  });
376
419
  }
377
420
 
421
+ scrollToAndHighlight() {
422
+ this.scrollToItem();
423
+ setTimeout(() => {
424
+ this.highlight();
425
+ }, 1000);
426
+ }
427
+
428
+ scrollToItem() {
429
+ const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
430
+ if (reduceMotion) this.scrollIntoView();
431
+ else this.scrollIntoView({ behavior: 'smooth' });
432
+ }
433
+
378
434
  _getNestedList() {
379
435
  if (!this.shadowRoot) return;
380
436
  const nestedSlot = this.shadowRoot.querySelector('slot[name="nested"]');
@@ -470,6 +526,8 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
470
526
  const classes = {
471
527
  'd2l-visible-on-ancestor-target': true,
472
528
  'd2l-list-item-content-extend-separators': this._extendSeparators,
529
+ 'd2l-list-item-highlight': this._highlight,
530
+ 'd2l-list-item-highlighting': this._highlighting,
473
531
  'd2l-focusing': this._focusing,
474
532
  'd2l-hovering': this._hovering,
475
533
  'd2l-dragging-over': this._draggingOver
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.236.2",
3
+ "version": "1.237.0",
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",
@@ -679,7 +679,7 @@ class TemplatePrimarySecondary extends FocusVisiblePolyfillMixin(RtlMixin(Locali
679
679
  z-index: 1; /* ensures the footer box-shadow is over main areas with background colours set */
680
680
  }
681
681
  header {
682
- z-index: 2; /* ensures the header box-shadow is over main areas with background colours set */
682
+ z-index: 14; /* ensures the header box-shadow is over main areas with background colours set, and opt-in on top of sticky header */
683
683
  }
684
684
 
685
685
  :host([resizable]) .d2l-template-primary-secondary-divider:focus,