@brightspace-ui/core 3.124.0 → 3.124.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.
@@ -257,7 +257,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
257
257
  transform-origin: 0.4rem;
258
258
  }
259
259
  :host([expanded]) d2l-icon-custom svg {
260
- fill: var(--d2l-color-tungsten);
260
+ fill: currentColor;
261
261
  transform: rotate(90deg);
262
262
  }
263
263
  @media (prefers-reduced-motion: no-preference) {
@@ -457,7 +457,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
457
457
  </div>
458
458
  <d2l-icon-custom size="tier1" class="d2l-skeletize" aria-hidden="true">
459
459
  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="18" fill="none" viewBox="0 0 10 18">
460
- <path stroke="var(--d2l-color-tungsten)" stroke-linejoin="round" stroke-width="2" d="m9 9-8 8V1l8 8Z"/>
460
+ <path stroke="currentColor" stroke-linejoin="round" stroke-width="2" d="m9 9-8 8V1l8 8Z"/>
461
461
  </svg>
462
462
  </d2l-icon-custom>
463
463
  </div>
@@ -7,6 +7,14 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
7
7
  import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
8
8
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
9
9
 
10
+ function debounce(func, delay) {
11
+ let timer = 0;
12
+ return function() {
13
+ clearTimeout(timer);
14
+ timer = setTimeout(func, delay);
15
+ };
16
+ }
17
+
10
18
  class InputDateTimeRangeTo extends SkeletonMixin(LocalizeCoreElement(LitElement)) {
11
19
 
12
20
  static get properties() {
@@ -169,13 +177,13 @@ class InputDateTimeRangeTo extends SkeletonMixin(LocalizeCoreElement(LitElement)
169
177
  this._leftElemResizeObserver.disconnect();
170
178
  this._leftElemResizeObserver.observe(leftElem);
171
179
 
172
- this._parentElemResizeObserver = this._parentElemResizeObserver || new ResizeObserver(async() => {
180
+ this._parentElemResizeObserver = this._parentElemResizeObserver || new ResizeObserver(debounce(async() => {
173
181
  this._blockDisplay = false;
174
182
  await this.updateComplete;
175
183
  const height = Math.ceil(parseFloat(getComputedStyle(container).getPropertyValue('height')));
176
184
  if (height >= (leftElemHeight * 2)) this._blockDisplay = true; // switch to _blockDisplay styles if content has wrapped (needed for "to" to occupy its own line)
177
185
  else this._blockDisplay = false;
178
- });
186
+ }, 5).bind(this));
179
187
  this._parentElemResizeObserver.disconnect();
180
188
  this._parentElemResizeObserver.observe(this._parentNode);
181
189
  }
@@ -1,7 +1,7 @@
1
1
  import '../colors/colors.js';
2
2
  import '../icons/icon.js';
3
3
  import '../icons/icon-custom.js';
4
- import { html, LitElement } from 'lit';
4
+ import { css, html, LitElement } from 'lit';
5
5
  import { SwitchMixin } from './switch-mixin.js';
6
6
 
7
7
  /**
@@ -11,11 +11,19 @@ import { SwitchMixin } from './switch-mixin.js';
11
11
  */
12
12
  class Switch extends SwitchMixin(LitElement) {
13
13
 
14
+ static get styles() {
15
+ return [super.styles, css`
16
+ .d2l-switch-icon-off > d2l-icon-custom {
17
+ color: var(--d2l-color-ferrite);
18
+ }
19
+ `];
20
+ }
21
+
14
22
  get offIcon() {
15
23
  return html`
16
24
  <d2l-icon-custom size="tier1">
17
25
  <svg viewBox="0 0 18 18" height="18" width="18" xmlns="http://www.w3.org/2000/svg">
18
- <circle cx="9" cy="9" r="6" stroke="var(--d2l-color-ferrite)" stroke-width="3" fill="none" />
26
+ <circle cx="9" cy="9" r="6" stroke="currentColor" stroke-width="3" fill="none" />
19
27
  </svg>
20
28
  </d2l-icon-custom>
21
29
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.124.0",
3
+ "version": "3.124.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",