@brightspace-ui/core 2.115.1 → 2.116.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.
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { bodySmallStyles } from '../typography/styles.js';
|
|
4
|
+
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A component for a "summary item" child component that describes the content in a collapsible panel.
|
|
7
8
|
*/
|
|
8
|
-
class CollapsiblePanelSummaryItem extends LitElement {
|
|
9
|
+
class CollapsiblePanelSummaryItem extends SkeletonMixin(LitElement) {
|
|
9
10
|
|
|
10
11
|
static get properties() {
|
|
11
12
|
return {
|
|
@@ -18,7 +19,7 @@ class CollapsiblePanelSummaryItem extends LitElement {
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
static get styles() {
|
|
21
|
-
return [bodySmallStyles, css`
|
|
22
|
+
return [super.styles, bodySmallStyles, css`
|
|
22
23
|
:host {
|
|
23
24
|
color: var(--d2l-color-galena);
|
|
24
25
|
display: block;
|
|
@@ -38,7 +39,7 @@ class CollapsiblePanelSummaryItem extends LitElement {
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
render() {
|
|
41
|
-
return html`<p class="d2l-body-small">${this.text}</p>`;
|
|
42
|
+
return html`<p class="d2l-body-small d2l-skeletize">${this.text}</p>`;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -7,6 +7,7 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
7
7
|
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
8
8
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
9
9
|
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
10
|
+
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
10
11
|
|
|
11
12
|
const normalizeHeadingNumber = (number) => {
|
|
12
13
|
number = parseInt(number);
|
|
@@ -26,7 +27,7 @@ const defaultHeading = 3;
|
|
|
26
27
|
* @fires d2l-collapsible-panel-expand - Dispatched when the panel is expanded
|
|
27
28
|
* @fires d2l-collapsible-panel-collapse - Dispatched when the panel is collapsed
|
|
28
29
|
*/
|
|
29
|
-
class CollapsiblePanel extends FocusMixin(RtlMixin(LitElement)) {
|
|
30
|
+
class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
|
|
30
31
|
|
|
31
32
|
static get properties() {
|
|
32
33
|
return {
|
|
@@ -82,7 +83,7 @@ class CollapsiblePanel extends FocusMixin(RtlMixin(LitElement)) {
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
static get styles() {
|
|
85
|
-
return [heading1Styles, heading2Styles, heading3Styles, heading4Styles, offscreenStyles, css`
|
|
86
|
+
return [super.styles, heading1Styles, heading2Styles, heading3Styles, heading4Styles, offscreenStyles, css`
|
|
86
87
|
:host {
|
|
87
88
|
--d2l-collapsible-panel-focus-outline: solid 2px var(--d2l-color-celestine);
|
|
88
89
|
--d2l-collapsible-panel-spacing-inline: 0.9rem;
|
|
@@ -101,7 +102,7 @@ class CollapsiblePanel extends FocusMixin(RtlMixin(LitElement)) {
|
|
|
101
102
|
border: 1px solid var(--d2l-color-mica);
|
|
102
103
|
border-radius: 0.4rem;
|
|
103
104
|
}
|
|
104
|
-
:host(:not([expanded])) .d2l-collapsible-panel {
|
|
105
|
+
:host(:not([expanded]):not([skeleton])) .d2l-collapsible-panel {
|
|
105
106
|
cursor: pointer;
|
|
106
107
|
}
|
|
107
108
|
:host([type="subtle"]) .d2l-collapsible-panel {
|
|
@@ -123,9 +124,11 @@ class CollapsiblePanel extends FocusMixin(RtlMixin(LitElement)) {
|
|
|
123
124
|
}
|
|
124
125
|
.d2l-collapsible-panel-header {
|
|
125
126
|
border-radius: 0.4rem;
|
|
126
|
-
cursor: pointer;
|
|
127
127
|
padding: var(--d2l-collapsible-panel-header-spacing) 0;
|
|
128
128
|
}
|
|
129
|
+
:host(:not([skeleton])) .d2l-collapsible-panel-header {
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
}
|
|
129
132
|
:host([type="inline"]) .d2l-collapsible-panel-header {
|
|
130
133
|
border-radius: 0;
|
|
131
134
|
outline-offset: -2px;
|
|
@@ -393,7 +396,7 @@ class CollapsiblePanel extends FocusMixin(RtlMixin(LitElement)) {
|
|
|
393
396
|
<slot name="actions"></slot>
|
|
394
397
|
</div>
|
|
395
398
|
<div class="d2l-collapsible-panel-opener">
|
|
396
|
-
<d2l-icon-custom size="tier1">
|
|
399
|
+
<d2l-icon-custom size="tier1" class="d2l-skeletize">
|
|
397
400
|
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="18" fill="none" viewBox="0 0 10 18">
|
|
398
401
|
<path stroke="var(--d2l-color-tungsten)" stroke-linejoin="round" stroke-width="2" d="m9 9-8 8V1l8 8Z"/>
|
|
399
402
|
</svg>
|
|
@@ -414,6 +417,7 @@ class CollapsiblePanel extends FocusMixin(RtlMixin(LitElement)) {
|
|
|
414
417
|
|
|
415
418
|
const titleClasses = {
|
|
416
419
|
'd2l-collapsible-panel-title': true,
|
|
420
|
+
'd2l-skeletize': true,
|
|
417
421
|
[`d2l-heading-${headingStyle}`]: true,
|
|
418
422
|
};
|
|
419
423
|
|
|
@@ -449,6 +453,7 @@ class CollapsiblePanel extends FocusMixin(RtlMixin(LitElement)) {
|
|
|
449
453
|
}
|
|
450
454
|
|
|
451
455
|
_toggleExpand() {
|
|
456
|
+
if (this.skeleton) return;
|
|
452
457
|
this.expanded = !this.expanded;
|
|
453
458
|
}
|
|
454
459
|
}
|
package/custom-elements.json
CHANGED
|
@@ -1156,6 +1156,12 @@
|
|
|
1156
1156
|
"description": "REQUIRED: Text that is displayed",
|
|
1157
1157
|
"type": "string",
|
|
1158
1158
|
"default": "\"\""
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"name": "skeleton",
|
|
1162
|
+
"description": "Renders the input as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton)",
|
|
1163
|
+
"type": "boolean",
|
|
1164
|
+
"default": "false"
|
|
1159
1165
|
}
|
|
1160
1166
|
],
|
|
1161
1167
|
"properties": [
|
|
@@ -1165,6 +1171,13 @@
|
|
|
1165
1171
|
"description": "REQUIRED: Text that is displayed",
|
|
1166
1172
|
"type": "string",
|
|
1167
1173
|
"default": "\"\""
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"name": "skeleton",
|
|
1177
|
+
"attribute": "skeleton",
|
|
1178
|
+
"description": "Renders the input as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton)",
|
|
1179
|
+
"type": "boolean",
|
|
1180
|
+
"default": "false"
|
|
1168
1181
|
}
|
|
1169
1182
|
]
|
|
1170
1183
|
},
|
|
@@ -1218,6 +1231,12 @@
|
|
|
1218
1231
|
"description": "Disables sticky positioning for the header",
|
|
1219
1232
|
"type": "boolean",
|
|
1220
1233
|
"default": "false"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"name": "skeleton",
|
|
1237
|
+
"description": "Renders the input as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton)",
|
|
1238
|
+
"type": "boolean",
|
|
1239
|
+
"default": "false"
|
|
1221
1240
|
}
|
|
1222
1241
|
],
|
|
1223
1242
|
"properties": [
|
|
@@ -1274,6 +1293,13 @@
|
|
|
1274
1293
|
"description": "Disables sticky positioning for the header",
|
|
1275
1294
|
"type": "boolean",
|
|
1276
1295
|
"default": "false"
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"name": "skeleton",
|
|
1299
|
+
"attribute": "skeleton",
|
|
1300
|
+
"description": "Renders the input as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton)",
|
|
1301
|
+
"type": "boolean",
|
|
1302
|
+
"default": "false"
|
|
1277
1303
|
}
|
|
1278
1304
|
],
|
|
1279
1305
|
"events": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.116.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",
|