@brightspace-ui/core 3.227.15 → 3.227.16

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,7 +1,7 @@
1
1
  import '../colors/colors.js';
2
2
  import '../loading-spinner/loading-spinner.js';
3
3
  import { css, html, LitElement, nothing } from 'lit';
4
- import { getOffsetParent } from '../../helpers/dom.js';
4
+ import { getComposedChildren, getComposedParent } from '../../helpers/dom.js';
5
5
  import { styleMap } from 'lit/directives/style-map.js';
6
6
 
7
7
  const BACKDROP_DELAY_MS = 800;
@@ -25,6 +25,11 @@ class LoadingBackdrop extends LitElement {
25
25
  * @type {boolean}
26
26
  */
27
27
  shown: { type: Boolean },
28
+ /**
29
+ * Used to identify content that the backdrop should make inert
30
+ * @type {boolean}
31
+ */
32
+ for: { type: String },
28
33
  _state: { type: String, reflect: true },
29
34
  _spinnerTop: { state: true }
30
35
  };
@@ -156,6 +161,19 @@ class LoadingBackdrop extends LitElement {
156
161
  this._state = 'hiding';
157
162
  }
158
163
  }
164
+ #getBackdropTarget() {
165
+ const parent = getComposedParent(this);
166
+
167
+ if (!this.for) { return parent; }
168
+
169
+ const targetedChildren = getComposedChildren(
170
+ parent,
171
+ (elem) => elem.id === this.for,
172
+ false
173
+ );
174
+
175
+ return targetedChildren.length === 0 ? parent : targetedChildren[0];
176
+ }
159
177
  #handleTransitionEnd() {
160
178
  if (this._state === 'hiding') {
161
179
  this.#hide();
@@ -164,14 +182,14 @@ class LoadingBackdrop extends LitElement {
164
182
  #hide() {
165
183
  this._state = 'hidden';
166
184
 
167
- const containingBlock = getOffsetParent(this);
185
+ const containingBlock = this.#getBackdropTarget();
168
186
 
169
187
  if (containingBlock.dataset.initiallyInert !== '1') containingBlock.removeAttribute('inert');
170
188
  }
171
189
  #show() {
172
190
  this._state = reduceMotion ? 'shown' : 'showing';
173
191
 
174
- const containingBlock = getOffsetParent(this);
192
+ const containingBlock = this.#getBackdropTarget();
175
193
 
176
194
  if (containingBlock.getAttribute('inert') !== null) containingBlock.dataset.initiallyInert = '1';
177
195
 
@@ -29,7 +29,7 @@ class CollapsiblePanelSummaryItem extends SkeletonMixin(LitElement) {
29
29
  static get styles() {
30
30
  return [super.styles, bodySmallStyles, css`
31
31
  :host {
32
- color: var(--d2l-color-galena);
32
+ color: var(--d2l-theme-text-color-static-faint);
33
33
  display: block;
34
34
  }
35
35
  :host([hidden]) {
@@ -111,7 +111,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(LitElement)) {
111
111
  static get styles() {
112
112
  return [super.styles, heading1Styles, heading2Styles, heading3Styles, heading4Styles, css`
113
113
  :host {
114
- --d2l-collapsible-panel-focus-outline: solid 2px var(--d2l-color-celestine);
114
+ --d2l-collapsible-panel-focus-outline: solid 2px var(--d2l-theme-border-color-focus);
115
115
  --d2l-collapsible-panel-spacing-inline: 0.9rem;
116
116
  --d2l-collapsible-panel-header-spacing: 0.6rem;
117
117
  --d2l-collapsible-panel-transition-time: 0.2s;
@@ -125,16 +125,16 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(LitElement)) {
125
125
  --d2l-collapsible-panel-spacing-inline: 2rem;
126
126
  }
127
127
  .d2l-collapsible-panel {
128
- border: 1px solid var(--d2l-color-mica);
128
+ border: 1px solid var(--d2l-theme-border-color-standard);
129
129
  border-radius: 0.4rem;
130
130
  }
131
131
  :host(:not([expanded]):not([skeleton])) .d2l-collapsible-panel {
132
132
  cursor: pointer;
133
133
  }
134
134
  :host([type="subtle"]) .d2l-collapsible-panel {
135
- background-color: white;
135
+ background-color: var(--d2l-theme-background-color-base);
136
136
  border: none;
137
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.03);
137
+ box-shadow: var(--d2l-theme-shadow-attached);
138
138
  }
139
139
  :host([type="inline"]) .d2l-collapsible-panel {
140
140
  border-left: none;
@@ -174,7 +174,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(LitElement)) {
174
174
  outline-offset: -2px;
175
175
  }
176
176
  .d2l-collapsible-panel.scrolled .d2l-collapsible-panel-header {
177
- background-color: white;
177
+ background-color: var(--d2l-theme-background-color-base);
178
178
  box-shadow: 0 8px 12px -9px rgba(0, 0, 0, 0.3);
179
179
  position: sticky;
180
180
  top: 0;
@@ -234,7 +234,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(LitElement)) {
234
234
  gap: 0.3rem;
235
235
  }
236
236
  .d2l-collapsible-panel-header-actions::after {
237
- border-inline-end: 1px solid var(--d2l-color-mica);
237
+ border-inline-end: 1px solid var(--d2l-theme-border-color-standard);
238
238
  content: "";
239
239
  display: flex;
240
240
  margin: 0.3rem;
@@ -300,7 +300,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(LitElement)) {
300
300
  /* stylelint-enable */
301
301
  }
302
302
  .d2l-collapsible-panel-divider {
303
- border-bottom: 1px solid var(--d2l-color-mica);
303
+ border-bottom: 1px solid var(--d2l-theme-border-color-standard);
304
304
  margin-inline: var(--d2l-collapsible-panel-spacing-inline);
305
305
  opacity: 1;
306
306
  }
@@ -164,7 +164,6 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
164
164
  }
165
165
 
166
166
  _renderCheckbox() {
167
- /* eslint-disable lit/no-private-properties */
168
167
  return this.selectable ? html`
169
168
  <d2l-selection-input
170
169
  @d2l-selection-change="${this._onCheckboxChange}"
@@ -181,7 +180,6 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
181
180
  ?skeleton="${this.skeleton}">
182
181
  </d2l-selection-input>
183
182
  ` : nothing;
184
- /* eslint-enable */
185
183
  }
186
184
 
187
185
  _renderCheckboxAction(inner) {
@@ -420,8 +420,10 @@ export class TableWrapper extends PageableMixin(SelectionMixin(LitElement)) {
420
420
 
421
421
  render() {
422
422
  const slot = html`
423
- <slot @slotchange="${this._handleSlotChange}"></slot>
424
- <d2l-backdrop-loading ?shown=${this.loading}></d2l-backdrop-loading>
423
+ <div style="position:relative">
424
+ <slot id="table-slot" @slotchange="${this._handleSlotChange}"></slot>
425
+ <d2l-backdrop-loading for="table-slot" ?shown=${this.loading}></d2l-backdrop-loading>
426
+ </div>
425
427
  `;
426
428
  const useScrollWrapper = this.stickyHeadersScrollWrapper || !this.stickyHeaders;
427
429
  return html`
@@ -191,6 +191,11 @@
191
191
  "path": "./components/backdrop/backdrop-loading.js",
192
192
  "description": "A component for displaying a semi-transparent backdrop and a loading spinner over the containing element",
193
193
  "attributes": [
194
+ {
195
+ "name": "for",
196
+ "description": "Used to identify content that the backdrop should make inert",
197
+ "type": "boolean"
198
+ },
194
199
  {
195
200
  "name": "shown",
196
201
  "description": "Used to control whether the loading backdrop is shown",
@@ -199,6 +204,12 @@
199
204
  }
200
205
  ],
201
206
  "properties": [
207
+ {
208
+ "name": "for",
209
+ "attribute": "for",
210
+ "description": "Used to identify content that the backdrop should make inert",
211
+ "type": "boolean"
212
+ },
202
213
  {
203
214
  "name": "shown",
204
215
  "attribute": "shown",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.227.15",
3
+ "version": "3.227.16",
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",
@@ -57,7 +57,7 @@
57
57
  "chalk": "^5",
58
58
  "eslint": "^9",
59
59
  "eslint-config-brightspace": "^2.0.0",
60
- "eslint-plugin-unicorn": "^63",
60
+ "eslint-plugin-unicorn": "^64",
61
61
  "glob-all": "^3",
62
62
  "messageformat-validator": "^3.0.0-beta",
63
63
  "rollup": "^4",