@brightspace-ui/core 2.147.0 → 2.148.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.
@@ -236,6 +236,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
236
236
 
237
237
  const dropdownContent = singleDimension ? html`
238
238
  <d2l-dropdown-content
239
+ class="vdiff-target"
239
240
  min-width="285"
240
241
  max-width="420"
241
242
  mobile-tray="right"
@@ -249,6 +250,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
249
250
  </d2l-dropdown-content>`
250
251
  : html`
251
252
  <d2l-dropdown-menu
253
+ class="vdiff-target"
252
254
  min-width="285"
253
255
  max-width="420"
254
256
  mobile-tray="right"
@@ -265,6 +267,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
265
267
 
266
268
  return html`
267
269
  <d2l-dropdown-button-subtle
270
+ class="vdiff-target"
268
271
  @d2l-dropdown-close="${this._handleDropdownClose}"
269
272
  @d2l-dropdown-open="${this._handleDropdownOpen}"
270
273
  @d2l-dropdown-position="${this._stopPropagation}"
@@ -31,7 +31,7 @@ export class ListControls extends SelectionControls {
31
31
  padding: 0 0.9rem;
32
32
  }
33
33
  .d2l-list-controls-color.d2l-list-controls-extend-separator {
34
- padding: 0 calc(0.9rem + 9px);
34
+ padding: 0 calc(0.6rem + 9px);
35
35
  }
36
36
  `];
37
37
  }
@@ -48,6 +48,7 @@ const ro = new ResizeObserver(entries => {
48
48
  });
49
49
 
50
50
  const defaultBreakpoints = [842, 636, 580, 0];
51
+ const SLIM_COLOR_BREAKPOINT = 400;
51
52
 
52
53
  /**
53
54
  * @property label - The hidden label for the checkbox and expand collapse control
@@ -99,7 +100,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
99
100
  _highlight: { type: Boolean, reflect: true },
100
101
  _highlighting: { type: Boolean, reflect: true },
101
102
  _hasNestedList: { state: true },
102
- _siblingHasColor: { state: true }
103
+ _siblingHasColor: { state: true },
104
+ _slimColor: { state: true }
103
105
  };
104
106
  }
105
107
 
@@ -293,6 +295,9 @@ export const ListItemMixin = superclass => class extends composeMixins(
293
295
  :host(:not([_render-expand-collapse-slot])) .d2l-list-item-content-extend-separators d2l-selection-input {
294
296
  margin-inline-start: 0.9rem;
295
297
  }
298
+ :host(:not([_render-expand-collapse-slot])[_has-color-slot]) .d2l-list-item-content-extend-separators d2l-selection-input {
299
+ margin-inline-start: 0.6rem;
300
+ }
296
301
 
297
302
  d2l-list-item-drag-handle {
298
303
  margin: 0.25rem 0.3rem;
@@ -391,6 +396,10 @@ export const ListItemMixin = superclass => class extends composeMixins(
391
396
  height: 100%;
392
397
  width: 6px;
393
398
  }
399
+ .d2l-list-item-color-inner.d2l-list-item-color-slim {
400
+ border-radius: 3px;
401
+ width: 3px;
402
+ }
394
403
  .d2l-list-item-color-outer {
395
404
  padding: 2px 12px 1px 0;
396
405
  }
@@ -435,6 +444,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
435
444
  this._hasColorSlot = false;
436
445
  this._hasNestedList = false;
437
446
  this._siblingHasColor = false;
447
+ this._slimColor = false;
438
448
  }
439
449
 
440
450
  get breakpoints() {
@@ -456,6 +466,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
456
466
  const oldValue = this._color;
457
467
  this._color = getValidHexColor(value, true);
458
468
  this.requestUpdate('value', oldValue);
469
+ /** @ignore */
459
470
  this.dispatchEvent(new CustomEvent('d2l-list-item-property-change', { bubbles: true, composed: true, detail: { name: 'color', value: this._color } }));
460
471
  }
461
472
 
@@ -512,6 +523,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
512
523
  }
513
524
 
514
525
  resizedCallback(width) {
526
+ this._slimColor = (width < SLIM_COLOR_BREAKPOINT);
527
+
515
528
  const lastBreakpointIndexToCheck = 3;
516
529
  this.breakpoints.some((breakpoint, index) => {
517
530
  if (width >= breakpoint || index > lastBreakpointIndexToCheck) {
@@ -674,6 +687,10 @@ export const ListItemMixin = superclass => class extends composeMixins(
674
687
  const colorStyles = {
675
688
  backgroundColor: this._hasColorSlot ? this.color : undefined
676
689
  };
690
+ const colorClasses = {
691
+ 'd2l-list-item-color-inner': true,
692
+ 'd2l-list-item-color-slim': this._slimColor
693
+ };
677
694
 
678
695
  const alignNested = ((this.draggable && this.selectable) || (this.expandable && this.selectable && this.color)) ? 'control' : undefined;
679
696
  const primaryAction = ((!this.noPrimaryAction && this._renderPrimaryAction) ? this._renderPrimaryAction(this._contentId) : null);
@@ -695,7 +712,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
695
712
  <div slot="control-container"></div>
696
713
  ${this._hasColorSlot ? html`
697
714
  <div slot="color-indicator" class="d2l-list-item-color-outer">
698
- <div class="d2l-list-item-color-inner" style="${styleMap(colorStyles)}"></div>
715
+ <div class="${classMap(colorClasses)}" style="${styleMap(colorStyles)}"></div>
699
716
  </div>` : nothing}
700
717
  <div slot="expand-collapse" class="d2l-list-expand-collapse" @click="${this._toggleExpandCollapse}">
701
718
  ${this._renderExpandCollapse()}
@@ -8124,9 +8124,6 @@
8124
8124
  }
8125
8125
  ],
8126
8126
  "events": [
8127
- {
8128
- "name": "d2l-list-item-property-change"
8129
- },
8130
8127
  {
8131
8128
  "name": "d2l-list-item-selected",
8132
8129
  "description": "Dispatched when the component item is selected"
@@ -8492,9 +8489,6 @@
8492
8489
  "name": "d2l-list-item-button-click",
8493
8490
  "description": "Dispatched when the item's primary button action is clicked"
8494
8491
  },
8495
- {
8496
- "name": "d2l-list-item-property-change"
8497
- },
8498
8492
  {
8499
8493
  "name": "d2l-list-item-selected",
8500
8494
  "description": "Dispatched when the component item is selected"
@@ -8983,9 +8977,6 @@
8983
8977
  "name": "d2l-list-item-link-click",
8984
8978
  "description": "Dispatched when the item's primary link action is clicked"
8985
8979
  },
8986
- {
8987
- "name": "d2l-list-item-property-change"
8988
- },
8989
8980
  {
8990
8981
  "name": "d2l-list-item-selected",
8991
8982
  "description": "Dispatched when the component item is selected"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.147.0",
3
+ "version": "2.148.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",
@@ -46,7 +46,7 @@
46
46
  "devDependencies": {
47
47
  "@babel/eslint-parser": "^7",
48
48
  "@brightspace-ui/stylelint-config": "^0.8",
49
- "@brightspace-ui/testing": "^0.34",
49
+ "@brightspace-ui/testing": "^0.35",
50
50
  "@open-wc/semantic-dom-diff": "^0.20",
51
51
  "@rollup/plugin-dynamic-import-vars": "^2",
52
52
  "@rollup/plugin-node-resolve": "^15",