@brightspace-ui/core 2.86.0 → 2.86.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.
@@ -84,16 +84,16 @@
84
84
  <d2l-demo-snippet>
85
85
  <template>
86
86
  <d2l-list grid>
87
- <d2l-list-item selectable key="1" label="Introductory Earth Sciences">
87
+ <d2l-list-item no-primary-action selectable key="1" label="Introductory Earth Sciences">
88
88
  <img slot="illustration" src="https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg"></img>
89
89
  <div>
90
90
  <d2l-list-item-content>
91
91
  <div>Introductory Earth Sciences</div>
92
92
  </d2l-list-item-content>
93
93
  <d2l-tag-list description="Tags for this course">
94
- <d2l-tag-list-item text="Science"></d2l-tag-list-item>
95
- <d2l-tag-list-item text="Environment"></d2l-tag-list-item>
96
- <d2l-tag-list-item text="Earth"></d2l-tag-list-item>
94
+ <d2l-tag-list-item text="Science" description="This is a description for the Science tag that is really really really long and will overflow onto the next line."></d2l-tag-list-item>
95
+ <d2l-tag-list-item text="Environment" description="This is a description for the Environment tag."></d2l-tag-list-item>
96
+ <d2l-tag-list-item text="Earth" description="This is a description for the Earth tag."></d2l-tag-list-item>
97
97
  </d2l-tag-list>
98
98
  </div>
99
99
  <div slot="actions">
@@ -116,8 +116,8 @@
116
116
  <div>Engineering Materials for Energy Systems</div>
117
117
  </d2l-list-item-content>
118
118
  <d2l-tag-list description="Tags for this course">
119
- <d2l-tag-list-item text="Engineering"></d2l-tag-list-item>
120
- <d2l-tag-list-item text="Energy Systems"></d2l-tag-list-item>
119
+ <d2l-tag-list-item text="Engineering" description="This is a description for the Engineering tag."></d2l-tag-list-item>
120
+ <d2l-tag-list-item text="Energy Systems" description="This is a description for the Energy Systems tag."></d2l-tag-list-item>
121
121
  </d2l-tag-list>
122
122
  </div>
123
123
  <div slot="actions">
@@ -140,9 +140,9 @@
140
140
  <div>Geomorphology and GIS</div>
141
141
  </d2l-list-item-content>
142
142
  <d2l-tag-list description="Tags for this course">
143
- <d2l-tag-list-item text="Geology"></d2l-tag-list-item>
144
- <d2l-tag-list-item text="GIS"></d2l-tag-list-item>
145
- <d2l-tag-list-item text="Earth Sciences"></d2l-tag-list-item>
143
+ <d2l-tag-list-item text="Geology" description="This is a description for the Geology tag."></d2l-tag-list-item>
144
+ <d2l-tag-list-item text="GIS" description="This is a description for the GIS tag."></d2l-tag-list-item>
145
+ <d2l-tag-list-item text="Earth Sciences" description="This is a description for the Earth Sciences tag."></d2l-tag-list-item>
146
146
  </d2l-tag-list>
147
147
  </div>
148
148
  <div slot="actions">
@@ -71,9 +71,13 @@
71
71
  <h2>Tooltip (info)</h2>
72
72
  <d2l-demo-snippet>
73
73
  <template>
74
- <d2l-button id="tooltip-info">Hover for Info</d2l-button>
75
- <d2l-tooltip for="tooltip-info">
76
- Your info message will display here
74
+ <d2l-button id="tooltip-preview">Preview</d2l-button>
75
+ <d2l-tooltip for="tooltip-preview">
76
+ Tooltip for the Preview button.
77
+ </d2l-tooltip>
78
+ <d2l-button id="tooltip-settings">Settings</d2l-button>
79
+ <d2l-tooltip for="tooltip-settings">
80
+ Tooltip for the Settings button.
77
81
  </d2l-tooltip>
78
82
  </template>
79
83
  </d2l-demo-snippet>
@@ -163,7 +167,6 @@
163
167
  <d2l-tooltip for="link-long" show-truncated-only>
164
168
  Very Very Very Very Long Text - this tooltip will show because the text is truncating.
165
169
  </d2l-tooltip>
166
-
167
170
  </div>
168
171
  </template>
169
172
  </d2l-demo-snippet>
@@ -11,6 +11,9 @@ import { styleMap } from 'lit/directives/style-map.js';
11
11
 
12
12
  let logAccessibilityWarning = true;
13
13
 
14
+ /* only one tooltip is to be shown at once - track the active tooltip so it can be hidden if necessary */
15
+ let activeTooltip = null;
16
+
14
17
  const pointerLength = 16;
15
18
  const pointerOverhang = 7; /* how far the pointer extends outside the content */
16
19
 
@@ -472,6 +475,7 @@ class Tooltip extends RtlMixin(LitElement) {
472
475
 
473
476
  disconnectedCallback() {
474
477
  super.disconnectedCallback();
478
+ if (activeTooltip === this) activeTooltip = null;
475
479
  this._removeListeners();
476
480
  window.removeEventListener('resize', this._onTargetResize);
477
481
  clearDismissible(this._dismissibleId);
@@ -882,6 +886,11 @@ class Tooltip extends RtlMixin(LitElement) {
882
886
  clearTimeout(this._hoverTimeout);
883
887
  clearTimeout(this._longPressTimeout);
884
888
  if (newValue) {
889
+ if (!this.forceShow) {
890
+ if (activeTooltip) activeTooltip.hide();
891
+ activeTooltip = this;
892
+ }
893
+
885
894
  this._dismissibleId = setDismissible(() => this.hide());
886
895
  this.setAttribute('aria-hidden', 'false');
887
896
  await this.updateComplete;
@@ -889,8 +898,11 @@ class Tooltip extends RtlMixin(LitElement) {
889
898
  this.dispatchEvent(new CustomEvent(
890
899
  'd2l-tooltip-show', { bubbles: true, composed: true }
891
900
  ));
901
+
892
902
  if (this.announced && !this._isInteractive(this._target)) announce(this.innerText);
893
903
  } else {
904
+ if (activeTooltip === this) activeTooltip = null;
905
+
894
906
  this.setAttribute('aria-hidden', 'true');
895
907
  if (this._dismissibleId) {
896
908
  clearDismissible(this._dismissibleId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.86.0",
3
+ "version": "2.86.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",