@brightspace-ui/core 3.88.1 → 3.88.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.
@@ -5,7 +5,7 @@ import { css, html, LitElement } from 'lit';
5
5
  import { heading1Styles, heading2Styles, heading3Styles, heading4Styles } from '../typography/styles.js';
6
6
  import { classMap } from 'lit/directives/class-map.js';
7
7
  import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
8
- import { offscreenStyles } from '../offscreen/offscreen.js';
8
+ import { ifDefined } from 'lit/directives/if-defined.js';
9
9
  import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
10
10
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
11
11
 
@@ -92,7 +92,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
92
92
  }
93
93
 
94
94
  static get styles() {
95
- return [super.styles, heading1Styles, heading2Styles, heading3Styles, heading4Styles, offscreenStyles, css`
95
+ return [super.styles, heading1Styles, heading2Styles, heading3Styles, heading4Styles, css`
96
96
  :host {
97
97
  --d2l-collapsible-panel-focus-outline: solid 2px var(--d2l-color-celestine);
98
98
  --d2l-collapsible-panel-spacing-inline: 0.9rem;
@@ -223,32 +223,37 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
223
223
  margin: 0.3rem;
224
224
  }
225
225
  .d2l-collapsible-panel-opener {
226
- align-self: self-start;
227
226
  background-color: transparent;
228
227
  border: none;
228
+ color: inherit;
229
229
  cursor: pointer;
230
- margin-inline-end: var(--d2l-collapsible-panel-spacing-inline);
231
- order: 1;
230
+ font-family: inherit;
231
+ font-size: inherit;
232
+ font-weight: inherit;
233
+ letter-spacing: inherit;
234
+ line-height: inherit;
232
235
  outline: none;
233
236
  padding-block: 0;
234
237
  padding-inline: 0;
238
+ text-align: inherit;
235
239
  }
236
- .d2l-collapsible-panel-opener > d2l-icon-custom {
240
+ d2l-icon-custom {
241
+ align-self: self-start;
237
242
  height: 0.9rem;
238
243
  margin: 0.6rem;
239
- margin-inline-end: 0;
244
+ margin-inline-end: var(--d2l-collapsible-panel-spacing-inline);
240
245
  position: relative;
241
246
  width: 0.9rem;
242
247
  }
243
- :host([dir="rtl"]) .d2l-collapsible-panel-opener > d2l-icon-custom {
248
+ :host([dir="rtl"]) d2l-icon-custom {
244
249
  transform: scale(-1, 1);
245
250
  transform-origin: center;
246
251
  }
247
- .d2l-collapsible-panel-opener > d2l-icon-custom svg {
252
+ d2l-icon-custom svg {
248
253
  position: absolute;
249
254
  transform-origin: 0.4rem;
250
255
  }
251
- :host([expanded]) .d2l-collapsible-panel-opener > d2l-icon-custom svg {
256
+ :host([expanded]) d2l-icon-custom svg {
252
257
  fill: var(--d2l-color-tungsten);
253
258
  transform: rotate(90deg);
254
259
  }
@@ -256,10 +261,10 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
256
261
  .d2l-collapsible-panel-divider {
257
262
  transition: opacity var(--d2l-collapsible-panel-transition-time) ease-in-out;
258
263
  }
259
- .d2l-collapsible-panel-opener > d2l-icon-custom svg {
264
+ d2l-icon-custom svg {
260
265
  animation: d2l-collapsible-panel-opener-close var(--d2l-collapsible-panel-arrow-time) ease-in-out;
261
266
  }
262
- :host([expanded]) .d2l-collapsible-panel-opener > d2l-icon-custom svg {
267
+ :host([expanded]) d2l-icon-custom svg {
263
268
  animation: d2l-collapsible-panel-opener-open var(--d2l-collapsible-panel-arrow-time) ease-in-out;
264
269
  }
265
270
  /* stylelint-disable order/properties-alphabetical-order */
@@ -432,32 +437,21 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
432
437
  }
433
438
 
434
439
  _renderHeader() {
435
- const expandCollapseLabel = this.expandCollapseLabel || this.panelTitle;
436
440
  return html`
437
441
  <div class="d2l-collapsible-panel-header" @click="${this._handleHeaderClick}">
438
442
  <div class="d2l-collapsible-panel-before">
439
443
  <slot name="before" @slotchange="${this._handleBeforeSlotChange}"></slot>
440
444
  </div>
441
445
  <div class="d2l-collapsible-panel-header-primary">
442
- <button
443
- class="d2l-collapsible-panel-opener"
444
- aria-expanded="${this.expanded}"
445
- type="button"
446
- @click="${this._handleHeaderClick}"
447
- @focus="${this._onFocus}"
448
- @blur="${this._onBlur}"
449
- aria-label="${expandCollapseLabel}"
450
- >
451
- <d2l-icon-custom size="tier1" class="d2l-skeletize">
452
- <svg xmlns="http://www.w3.org/2000/svg" width="10" height="18" fill="none" viewBox="0 0 10 18">
453
- <path stroke="var(--d2l-color-tungsten)" stroke-linejoin="round" stroke-width="2" d="m9 9-8 8V1l8 8Z"/>
454
- </svg>
455
- </d2l-icon-custom>
456
- </button>
457
446
  ${this._renderPanelTitle()}
458
447
  <div class="d2l-collapsible-panel-header-actions" @click="${this._handleActionsClick}">
459
448
  <slot name="actions"></slot>
460
449
  </div>
450
+ <d2l-icon-custom size="tier1" class="d2l-skeletize" aria-hidden="true">
451
+ <svg xmlns="http://www.w3.org/2000/svg" width="10" height="18" fill="none" viewBox="0 0 10 18">
452
+ <path stroke="var(--d2l-color-tungsten)" stroke-linejoin="round" stroke-width="2" d="m9 9-8 8V1l8 8Z"/>
453
+ </svg>
454
+ </d2l-icon-custom>
461
455
  </div>
462
456
  <div class="d2l-collapsible-panel-header-secondary" @click="${this._handleHeaderSecondaryClick}">
463
457
  <slot name="header"></slot>
@@ -477,14 +471,25 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
477
471
  [`d2l-heading-${headingStyle}`]: true,
478
472
  };
479
473
 
474
+ const button = html`
475
+ <button
476
+ class="d2l-collapsible-panel-opener"
477
+ aria-expanded="${this.expanded}"
478
+ type="button"
479
+ @click="${this._handleHeaderClick}"
480
+ @focus="${this._onFocus}"
481
+ @blur="${this._onBlur}"
482
+ aria-label="${ifDefined(this.expandCollapseLabel)}">${this.panelTitle}</button>
483
+ `;
484
+
480
485
  const headingLevel = normalizeHeadingLevel(this.headingLevel);
481
486
  switch (headingLevel) {
482
- case 1: return html`<h1 class="${classMap(titleClasses)}">${this.panelTitle}</h1>`;
483
- case 2: return html`<h2 class="${classMap(titleClasses)}">${this.panelTitle}</h2>`;
484
- case 3: return html`<h3 class="${classMap(titleClasses)}">${this.panelTitle}</h3>`;
485
- case 4: return html`<h4 class="${classMap(titleClasses)}">${this.panelTitle}</h4>`;
486
- case 5: return html`<h5 class="${classMap(titleClasses)}">${this.panelTitle}</h5>`;
487
- case 6: return html`<h6 class="${classMap(titleClasses)}">${this.panelTitle}</h6>`;
487
+ case 1: return html`<h1 class="${classMap(titleClasses)}">${button}</h1>`;
488
+ case 2: return html`<h2 class="${classMap(titleClasses)}">${button}</h2>`;
489
+ case 3: return html`<h3 class="${classMap(titleClasses)}">${button}</h3>`;
490
+ case 4: return html`<h4 class="${classMap(titleClasses)}">${button}</h4>`;
491
+ case 5: return html`<h5 class="${classMap(titleClasses)}">${button}</h5>`;
492
+ case 6: return html`<h6 class="${classMap(titleClasses)}">${button}</h6>`;
488
493
  }
489
494
  }
490
495
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.88.1",
3
+ "version": "3.88.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",