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