@brightspace-ui/core 3.159.1 → 3.159.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.
@@ -4,7 +4,6 @@ import { css, html, LitElement, nothing, unsafeCSS } from 'lit';
4
4
  import { getFocusPseudoClass, getFocusRingStyles } from '../../helpers/focus.js';
5
5
  import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor/visible-on-ancestor-mixin.js';
6
6
  import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
7
- import { getFlag } from '../../helpers/flags.js';
8
7
  import { getUniqueId } from '../../helpers/uniqueId.js';
9
8
  import { ifDefined } from 'lit/directives/if-defined.js';
10
9
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
@@ -15,7 +14,6 @@ const MODE = {
15
14
  icon_and_text: 'icon-and-text',
16
15
  icon_when_interacted: 'icon-when-interacted'
17
16
  };
18
- const whiteAddButtonBackgroundFlag = getFlag('GAUD-7495-add-button-white-background', true);
19
17
 
20
18
  /**
21
19
  * A component for quickly adding items to a specific locaiton.
@@ -32,8 +30,7 @@ class ButtonAdd extends PropertyRequiredMixin(FocusMixin(LocalizeCoreElement(Lit
32
30
  * ACCESSIBILITY: The text associated with the button. When mode is `icon-and-text` this text is displayed next to the icon, otherwise this text is in a tooltip.
33
31
  * @type {string}
34
32
  */
35
- text: { type: String, required: true },
36
- _whiteBackgroundAddButton: { type: Boolean, attribute: '_white-background-add-button', reflect: true }
33
+ text: { type: String, required: true }
37
34
  };
38
35
  }
39
36
 
@@ -105,10 +102,6 @@ class ButtonAdd extends PropertyRequiredMixin(FocusMixin(LocalizeCoreElement(Lit
105
102
  100% { position: static; }
106
103
  }
107
104
  ${getFocusRingStyles(pseudoClass => `button:${pseudoClass} d2l-button-add-icon-text`, { extraStyles: css`background-color: white; border-radius: 0.3rem;` })}
108
- /* remove when GAUD-7495-add-button-white-background is cleaned up */
109
- :host(:not([_white-background-add-button])) button:${unsafeCSS(getFocusPseudoClass())} d2l-button-add-icon-text {
110
- background-color: transparent;
111
- }
112
105
  :host([mode="icon-when-interacted"]) button:${unsafeCSS(getFocusPseudoClass())} d2l-button-add-icon-text,
113
106
  :host([mode="icon"]) button:${unsafeCSS(getFocusPseudoClass())} d2l-button-add-icon-text {
114
107
  border-radius: 0.2rem;
@@ -165,7 +158,6 @@ class ButtonAdd extends PropertyRequiredMixin(FocusMixin(LocalizeCoreElement(Lit
165
158
  this.mode = MODE.icon;
166
159
 
167
160
  this._buttonId = getUniqueId();
168
- this._whiteBackgroundAddButton = whiteAddButtonBackgroundFlag;
169
161
  }
170
162
 
171
163
  static get focusElementSelector() {
@@ -246,7 +238,7 @@ class ButtonAddIconText extends VisibleOnAncestorMixin(LitElement) {
246
238
  }
247
239
 
248
240
  render() {
249
- const whiteBackgroundAddButton = html`
241
+ return html`
250
242
  <svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
251
243
  <g>
252
244
  <circle cx="9" cy="9" r="9" fill="#fff"/>
@@ -254,17 +246,6 @@ class ButtonAddIconText extends VisibleOnAncestorMixin(LitElement) {
254
246
  <path fill-rule="evenodd" clip-rule="evenodd" d="M10 5a1 1 0 0 0-2 0v3H5a1 1 0 0 0 0 2h3v3a1 1 0 1 0 2 0v-3h3a1 1 0 1 0 0-2h-3V5Z"/>
255
247
  </g>
256
248
  </svg>
257
- `;
258
- const translucentBackgroundAddButton = html`
259
- <svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
260
- <g>
261
- <path fill-rule="evenodd" clip-rule="evenodd" d="M9 2C10.3845 2 11.7378 2.41054 12.889 3.17971C14.0401 3.94888 14.9373 5.04213 15.4672 6.32122C15.997 7.6003 16.1356 9.00777 15.8655 10.3656C15.5954 11.7235 14.9287 12.9708 13.9497 13.9497C12.9708 14.9287 11.7235 15.5954 10.3656 15.8655C9.00777 16.1356 7.6003 15.997 6.32122 15.4672C5.04213 14.9373 3.94888 14.0401 3.17971 12.889C2.41054 11.7378 2 10.3845 2 9C2.00212 7.14413 2.7403 5.36489 4.05259 4.05259C5.36489 2.7403 7.14413 2.00212 9 2V2ZM9 0C6.61305 0 4.32387 0.948212 2.63604 2.63604C0.948212 4.32387 0 6.61305 0 9C0 11.3869 0.948212 13.6761 2.63604 15.364C4.32387 17.0518 6.61305 18 9 18C11.3869 18 13.6761 17.0518 15.364 15.364C17.0518 13.6761 18 11.3869 18 9C18 6.61305 17.0518 4.32387 15.364 2.63604C13.6761 0.948212 11.3869 0 9 0V0Z" />
262
- <path fill-rule="evenodd" clip-rule="evenodd" d="M10 5C10 4.44772 9.55228 4 9 4C8.44772 4 8 4.44772 8 5V8H5C4.44772 8 4 8.44772 4 9C4 9.55228 4.44772 10 5 10H8V13C8 13.5523 8.44772 14 9 14C9.55228 14 10 13.5523 10 13V10H13C13.5523 10 14 9.55228 14 9C14 8.44772 13.5523 8 13 8H10V5Z" />
263
- </g>
264
- </svg>
265
- `;
266
- return html`
267
- ${whiteAddButtonBackgroundFlag ? whiteBackgroundAddButton : translucentBackgroundAddButton}
268
249
  ${this.text ? html`<span class="d2l-label-text">${this.text}</span>` : nothing}
269
250
  `;
270
251
  }
@@ -121,7 +121,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
121
121
  _listItemNewStyles: { type: Boolean, reflect: true, attribute: '_list-item-new-styles' },
122
122
  _showAddButton: { type: Boolean, attribute: '_show-add-button', reflect: true },
123
123
  _siblingHasColor: { state: true },
124
- _whiteBackgroundAddButton: { type: Boolean, attribute: '_white-background-add-button', reflect: true },
125
124
  };
126
125
  }
127
126
 
@@ -163,13 +162,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
163
162
  inset-inline-start: 1.5rem; /* left and right margins of 0.3rem + drag handle width of 0.9rem */
164
163
  width: calc(100% - 1.5rem);
165
164
  }
166
- :host(:not([_white-background-add-button])[_has-nested-list-add-button]) [slot="before-content"] {
167
- border-bottom: 1px solid var(--d2l-color-mica);
168
- margin-bottom: -1px;
169
- }
170
- :host(:not([_white-background-add-button])[_has-nested-list-add-button]:not([selection-disabled]):not([skeleton])[selected]) [slot="before-content"] {
171
- border-bottom-color: ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')}; /* stylelint-disable-line */
172
- }
173
165
  :host(:first-of-type) [slot="control-container"]::before {
174
166
  top: 0;
175
167
  }
@@ -191,9 +183,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
191
183
  :host([_focusing-primary-action]) [slot="control-container"]::after,
192
184
  :host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::before,
193
185
  :host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::after,
194
- :host(:not([_white-background-add-button])[_show-add-button]) [slot="control-container"]::before,
195
- .hide-bottom-border[slot="control-container"]::after,
196
- :host(:not([_white-background-add-button])[_has-nested-list-add-button]) [slot="control-container"]::after,
197
186
  :host(:first-of-type[_nested]) [slot="control-container"]::before {
198
187
  border-top-color: transparent;
199
188
  }
@@ -212,6 +201,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
212
201
  :host(:not([_has-color-slot])) .d2l-list-item-content-extend-separators [slot="content"] {
213
202
  padding-inline: 0.9rem;
214
203
  }
204
+ :host([selectable]:not([_has-color-slot])) .d2l-list-item-content-extend-separators [slot="content"],
215
205
  :host([selectable]) .d2l-list-item-content-extend-separators > [slot="content"] {
216
206
  padding-inline-start: 0;
217
207
  }
@@ -357,29 +347,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
357
347
  border-color: var(--d2l-color-mica);
358
348
  margin-bottom: -1px;
359
349
  }
360
- /* below hides the border under the d2l-button-add; clean up with GAUD-7495-add-button-white-background */
361
- :host([_hovering-control]) [slot="outside-control-container"].hide-bottom-border,
362
- :host([_hovering-primary-action]) [slot="outside-control-container"].hide-bottom-border,
363
- :host([_hovering-selection]) [slot="outside-control-container"].hide-bottom-border,
364
- :host([_focusing-primary-action]) [slot="outside-control-container"].hide-bottom-border,
365
- :host(:not([selection-disabled]):not([skeleton])[selected]) [slot="outside-control-container"].hide-bottom-border,
366
- :host(:not([selection-disabled]):not([skeleton])[selected][_hovering-selection]) [slot="outside-control-container"].hide-bottom-border,
367
- :host(:not([_list-item-new-styles]):not([selection-disabled]):not([skeleton])[selectable][_focusing]) [slot="outside-control-container"].hide-bottom-border,
368
- :host([_list-item-new-styles]:not([selection-disabled]):not([button-disabled]):not([skeleton])[_focusing]) [slot="outside-control-container"].hide-bottom-border {
369
- background-clip: content-box, border-box;
370
- background-image: linear-gradient(white, white), linear-gradient(to right, ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')} 20%, transparent 20%, transparent 80%, ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')} 80%); /* stylelint-disable-line */
371
- background-origin: border-box;
372
- border: double 1px transparent;
373
- border-radius: 6px;
374
- }
375
350
  /* clean up with GAUD-7495-list-item-new-styles flag */
376
- :host(:not([selection-disabled]):not([button-disabled]):not([skeleton])[_focusing-elem]) [slot="outside-control-container"].hide-bottom-border {
377
- background-clip: content-box, border-box;
378
- background-image: linear-gradient(white, white), linear-gradient(to right, var(--d2l-color-mica) 20%, transparent 20%, transparent 80%, var(--d2l-color-mica) 80%);
379
- background-origin: border-box;
380
- border: double 1px transparent;
381
- border-radius: 6px;
382
- }
383
351
  :host(:not([selection-disabled]):not([skeleton])[selected]) [slot="outside-control-container"].hide-bottom-border {
384
352
  background-image: linear-gradient(#f3fbff, #f3fbff), linear-gradient(to right, ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')} 20%, transparent 20%, transparent 80%, ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')} 80%); /* stylelint-disable-line */
385
353
  }
@@ -491,7 +459,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
491
459
  this._listItemInteractiveEnabled = listItemInteractiveFlag;
492
460
  this._listItemNewStyles = useNewStylesFlag;
493
461
  this._siblingHasColor = false;
494
- this._whiteBackgroundAddButton = getFlag('GAUD-7495-add-button-white-background', true);
495
462
  }
496
463
 
497
464
  get color() {
@@ -731,9 +698,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
731
698
  'd2l-list-item-color-inner': true,
732
699
  'd2l-skeletize': this.color
733
700
  };
734
- const bottomBorderClasses = {
735
- 'hide-bottom-border': !this._whiteBackgroundAddButton && (this._showAddButton && (!this._hasNestedList || this._hasNestedListAddButton))
736
- };
737
701
 
738
702
  const alignNested = ((this.draggable && this.selectable) || (this.expandable && this.selectable && this.color) || (this._listItemInteractiveEnabled && this.expandable && !this.selectable)) ? 'control' : undefined;
739
703
  const contentAreaContent = html`
@@ -781,12 +745,12 @@ export const ListItemMixin = superclass => class extends composeMixins(
781
745
  </d2l-button-add>
782
746
  </div>
783
747
  ` : nothing}
784
- <div slot="outside-control-container" class="${classMap(bottomBorderClasses)}"></div>
748
+ <div slot="outside-control-container"></div>
785
749
  <div slot="before-content"></div>
786
750
  ${this._renderDropTarget()}
787
751
  ${this._renderDragHandle(this._renderOutsideControl)}
788
752
  ${this._renderDragTarget(this.dragTargetHandleOnly ? this._renderOutsideControlHandleOnly : this._renderOutsideControlAction)}
789
- <div slot="control-container" class="${classMap(bottomBorderClasses)}"></div>
753
+ <div slot="control-container"></div>
790
754
  ${this._hasColorSlot ? html`
791
755
  <div slot="color-indicator" class="d2l-list-item-color-outer">
792
756
  <div class="${classMap(colorClasses)}" style="${styleMap(colorStyles)}"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.159.1",
3
+ "version": "3.159.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",