@brightspace-ui/core 2.176.1 → 2.176.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.
@@ -54,8 +54,9 @@ class ButtonAdd extends RtlMixin(PropertyRequiredMixin(FocusMixin(LocalizeCoreEl
54
54
  cursor: pointer;
55
55
  display: flex;
56
56
  font-family: inherit;
57
- height: 0.9rem;
57
+ height: 11px;
58
58
  justify-content: center;
59
+ margin: 6.5px 0; /* (d2l-button-add-icon-text height - line height) / 2 */
59
60
  outline: none;
60
61
  padding: 0;
61
62
  position: relative;
@@ -64,14 +65,14 @@ class ButtonAdd extends RtlMixin(PropertyRequiredMixin(FocusMixin(LocalizeCoreEl
64
65
  width: 100%;
65
66
  z-index: 1; /* needed for button-add to have expected hover behaviour in list (hover from below, tooltip position) */
66
67
  }
67
- :host([mode="icon-when-interacted"]) button {
68
- height: 7px;
68
+ :host([mode="icon-and-text"]) button {
69
+ margin: calc((1.5rem - 11px) / 2) 0; /* (d2l-button-add-icon-text height - line height) / 2 */
69
70
  }
70
71
 
71
72
  .line {
72
73
  background: var(--d2l-button-add-line-color);
73
74
  height: 1px;
74
- margin: 3px 0;
75
+ margin: 5px 0;
75
76
  width: 100%;
76
77
  }
77
78
 
@@ -167,13 +168,12 @@ class ButtonAdd extends RtlMixin(PropertyRequiredMixin(FocusMixin(LocalizeCoreEl
167
168
  render() {
168
169
  const text = this.text || this.localize('components.button-add.addItem');
169
170
  const id = !this.mode !== MODE.icon_and_text ? this._buttonId : undefined;
170
- const offset = this.mode === MODE.icon_when_interacted ? 23 : 18;
171
171
 
172
172
  const content = this.mode !== MODE.icon_and_text
173
173
  ? html`<d2l-button-add-icon-text ?visible-on-ancestor="${this.mode === MODE.icon_when_interacted}" animation-type="opacity"></d2l-button-add-icon-text>`
174
174
  : html`<d2l-button-add-icon-text text="${text}"></d2l-button-add-icon-text>`;
175
175
  const tooltip = this.mode !== MODE.icon_and_text
176
- ? html`<d2l-tooltip class="vdiff-target" delay="100" offset="${offset}" for="${this._buttonId}" for-type="label">${text}</d2l-tooltip>`
176
+ ? html`<d2l-tooltip class="vdiff-target" delay="100" offset="21" for="${this._buttonId}" for-type="label">${text}</d2l-tooltip>`
177
177
  : nothing;
178
178
 
179
179
  return html`
@@ -296,7 +296,7 @@
296
296
 
297
297
  <d2l-demo-snippet id="grid-link-demo">
298
298
  <template>
299
- <d2l-list grid>
299
+ <d2l-list grid add-button>
300
300
  <d2l-list-controls slot="controls">
301
301
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
302
302
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
@@ -92,6 +92,7 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
92
92
  ::slotted([slot="content"]),
93
93
  ::slotted([slot="actions"]),
94
94
  ::slotted([slot="outside-control-action"]),
95
+ ::slotted([slot="before-content"]),
95
96
  ::slotted([slot="control-action"]),
96
97
  ::slotted([slot="content-action"]),
97
98
  ::slotted([slot="outside-control-container"]),
@@ -127,6 +128,10 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
127
128
  grid-column: color-start / color-end;
128
129
  }
129
130
 
131
+ ::slotted([slot="before-content"]) {
132
+ grid-column: color-start / content-start;
133
+ }
134
+
130
135
  ::slotted([slot="control-action"]) ~ ::slotted([slot="content"]),
131
136
  ::slotted([slot="outside-control-action"]) ~ ::slotted([slot="content"]) {
132
137
  pointer-events: unset;
@@ -224,6 +229,7 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
224
229
 
225
230
  <slot name="control-container"></slot>
226
231
  <slot name="outside-control-container"></slot>
232
+ <slot name="before-content"></slot>
227
233
 
228
234
  <slot name="content-action" class="d2l-cell" data-cell-num="6"></slot>
229
235
  <slot name="outside-control" class="d2l-cell" data-cell-num="2"></slot>
@@ -82,6 +82,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
82
82
  _addButtonText: { state: true },
83
83
  _displayKeyboardTooltip: { type: Boolean },
84
84
  _hasColorSlot: { type: Boolean, reflect: true, attribute: '_has-color-slot' },
85
+ _hasNestedList: { type: Boolean, reflect: true, attribute: '_has-nested-list' },
85
86
  _hovering: { type: Boolean, reflect: true },
86
87
  _hoveringPrimaryAction: { type: Boolean, attribute: '_hovering-primary-action', reflect: true },
87
88
  _focusing: { type: Boolean, reflect: true },
@@ -89,7 +90,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
89
90
  _highlight: { type: Boolean, reflect: true },
90
91
  _highlighting: { type: Boolean, reflect: true },
91
92
  _showAddButton: { type: Boolean, attribute: '_show-add-button', reflect: true },
92
- _hasNestedList: { state: true },
93
93
  _siblingHasColor: { state: true },
94
94
  };
95
95
  }
@@ -125,6 +125,13 @@ export const ListItemMixin = superclass => class extends composeMixins(
125
125
  position: absolute;
126
126
  width: 100%;
127
127
  }
128
+ :host([_show-add-button][_has-nested-list]) [slot="before-content"] {
129
+ border-bottom: 1px solid var(--d2l-color-mica);
130
+ margin-bottom: -1px;
131
+ }
132
+ :host([_show-add-button][_has-nested-list]:not([selection-disabled]):not([skeleton])[selected]) [slot="before-content"] {
133
+ border-bottom-color: #b6cbe8;
134
+ }
128
135
  :host(:first-of-type) [slot="control-container"]::before {
129
136
  top: 0;
130
137
  }
@@ -265,9 +272,9 @@ export const ListItemMixin = superclass => class extends composeMixins(
265
272
  margin: 0 -12px;
266
273
  }
267
274
  .d2l-list-item-content-extend-separators [slot="outside-control-container"] {
268
- border-left: none;
269
- border-radius: 0;
270
- border-right: none;
275
+ border-left: none !important;
276
+ border-radius: 0 !important;
277
+ border-right: none !important;
271
278
  }
272
279
  :host([draggable]) [slot="outside-control-container"],
273
280
  .d2l-list-item-content-extend-separators [slot="outside-control-container"] {
@@ -297,13 +304,28 @@ export const ListItemMixin = superclass => class extends composeMixins(
297
304
  border-color: #b6cbe8; /* celestine alpha 0.3 */
298
305
  margin-bottom: -1px;
299
306
  }
307
+ /* below hides the border under the d2l-button-add */
308
+ :host([_hovering-primary-action][_show-add-button]) [slot="outside-control-container"],
309
+ :host([_hovering-selection][_show-add-button]) [slot="outside-control-container"],
310
+ :host([_focusing-primary-action][_show-add-button]) [slot="outside-control-container"],
311
+ :host(:not([selection-disabled]):not([skeleton])[selected][_show-add-button]) [slot="outside-control-container"],
312
+ :host(:not([selection-disabled]):not([skeleton])[selected][_hovering-selection][_show-add-button]) [slot="outside-control-container"],
313
+ :host(:not([selection-disabled]):not([skeleton])[selectable][_focusing][_show-add-button]) [slot="outside-control-container"] {
314
+ background-clip: content-box, border-box;
315
+ background-image: linear-gradient(white, white), linear-gradient(to right, #b6cbe8 20%, transparent 20%, transparent 80%, #b6cbe8 80%);
316
+ background-origin: border-box;
317
+ border: double 1px transparent;
318
+ border-radius: 6px;
319
+ }
320
+ :host(:not([selection-disabled]):not([skeleton])[selected][_show-add-button]) [slot="outside-control-container"] {
321
+ background-image: linear-gradient(#f3fbff, #f3fbff), linear-gradient(to right, #b6cbe8 20%, transparent 20%, transparent 80%, #b6cbe8 80%);
322
+ }
300
323
  :host([_hovering-primary-action]) d2l-button-add,
301
324
  :host([_hovering-selection]) d2l-button-add,
302
325
  :host([_focusing-primary-action]) d2l-button-add,
303
- :host(:not([selection-disabled]):not([skeleton])[selected][_hovering-selection]) d2l-button-add,
304
326
  :host(:not([selection-disabled]):not([skeleton])[selectable][_focusing]) d2l-button-add,
305
327
  :host(:not([selection-disabled]):not([skeleton])[selected]) d2l-button-add {
306
- --d2l-button-add-line-color: #b6cbe8;
328
+ --d2l-button-add-line-color: #b6cbe8; /* celestine alpha 0.3 */
307
329
  }
308
330
  :host([_hovering-primary-action]) [slot="outside-control-container"],
309
331
  :host([_hovering-selection]) [slot="outside-control-container"] {
@@ -387,8 +409,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
387
409
 
388
410
  [slot="add"],
389
411
  [slot="add-top"] {
390
- margin-bottom: -4px;
391
- margin-top: -3px;
412
+ margin-bottom: -12.5px;
413
+ margin-top: -11.5px;
392
414
  }
393
415
  :host([draggable][selectable][_hovering]) [slot="add"],
394
416
  :host([draggable][selectable][_focusing]) [slot="add"] {
@@ -655,6 +677,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
655
677
  </div>
656
678
  ` : nothing}
657
679
  <div slot="outside-control-container"></div>
680
+ <div slot="before-content"></div>
658
681
  ${this._renderDropTarget()}
659
682
  ${this._renderDragHandle(this._renderOutsideControl)}
660
683
  ${this._renderDragTarget(this.dragTargetHandleOnly ? this._renderOutsideControlHandleOnly : this._renderOutsideControlAction)}
@@ -323,9 +323,9 @@ class List extends PageableMixin(SelectionMixin(LitElement)) {
323
323
  _handleListItemAddButtonClick(e) {
324
324
  e.stopPropagation();
325
325
  /**
326
- * Dispatched when the add button directly after the item is clicked. Event detail includes position ('before' or 'after') and key.
327
- * The key belongs to the list item adjacent to where the new item should be positioned.
328
- * The position represents where the new item should be positioned relative to the item with that key.
326
+ * Dispatched when the add button directly before or after the item is clicked. Event detail includes position ('before' or 'after') and key.
327
+ * The `key` belongs to the list item adjacent to where the new item should be positioned.
328
+ * The `position` represents where the new item should be positioned relative to the item with that key.
329
329
  * */
330
330
  this.dispatchEvent(new CustomEvent('d2l-list-add-button-click', { detail: { key: e.target.key, position: e.detail.position } }));
331
331
  }
@@ -9203,7 +9203,7 @@
9203
9203
  },
9204
9204
  {
9205
9205
  "name": "d2l-list-add-button-click",
9206
- "description": "Dispatched when the add button directly after the item is clicked. Event detail includes position ('before' or 'after') and key.\nThe key belongs to the list item adjacent to where the new item should be positioned.\nThe position represents where the new item should be positioned relative to the item with that key."
9206
+ "description": "Dispatched when the add button directly before or after the item is clicked. Event detail includes position ('before' or 'after') and key.\nThe `key` belongs to the list item adjacent to where the new item should be positioned.\nThe `position` represents where the new item should be positioned relative to the item with that key."
9207
9207
  }
9208
9208
  ],
9209
9209
  "slots": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.176.1",
3
+ "version": "2.176.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",