@descope-ui/descope-tooltip 3.1.12 → 3.2.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [3.2.0](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.13...web-components-ui-3.2.0) (2026-04-16)
6
+
7
+ ## [3.1.13](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.12...web-components-ui-3.1.13) (2026-04-15)
8
+
5
9
  ## [3.1.12](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.11...web-components-ui-3.1.12) (2026-04-15)
6
10
 
7
11
  ## [3.1.11](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.10...web-components-ui-3.1.11) (2026-04-15)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope-ui/descope-tooltip",
3
- "version": "3.1.12",
3
+ "version": "3.2.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./src/component/index.js"
@@ -14,13 +14,13 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@playwright/test": "1.58.2",
17
- "e2e-utils": "3.1.12"
17
+ "e2e-utils": "3.2.0"
18
18
  },
19
19
  "dependencies": {
20
20
  "@vaadin/tooltip": "24.3.4",
21
- "@descope-ui/common": "3.1.12",
22
- "@descope-ui/theme-globals": "3.1.12",
23
- "@descope-ui/descope-enriched-text": "3.1.12"
21
+ "@descope-ui/common": "3.2.0",
22
+ "@descope-ui/theme-globals": "3.2.0",
23
+ "@descope-ui/descope-enriched-text": "3.2.0"
24
24
  },
25
25
  "publishConfig": {
26
26
  "link-workspace-packages": false
@@ -86,7 +86,7 @@ class RawTooltip extends BaseClass {
86
86
  this.tooltip.style.overflow = 'hidden';
87
87
  this.tooltip.style.position = 'absolute';
88
88
  }
89
-
89
+
90
90
  #revealWrappedParts() {
91
91
  this.tooltip.style.width = '100%';
92
92
  this.tooltip.style.height = '100%';
@@ -111,9 +111,7 @@ class RawTooltip extends BaseClass {
111
111
  #setTooltipTarget() {
112
112
  if (!this.children?.length) return;
113
113
 
114
- let ele = Array.from(this.children).find(
115
- (child) => child !== this.tooltip,
116
- );
114
+ let ele = Array.from(this.children).find((child) => child !== this.tooltip);
117
115
 
118
116
  if (!ele) return;
119
117
 
@@ -133,6 +131,10 @@ class RawTooltip extends BaseClass {
133
131
  return enrichedText;
134
132
  }
135
133
 
134
+ get srLabel() {
135
+ return this.tooltip?.querySelector('[slot="sr-label"]');
136
+ }
137
+
136
138
  #initTooltipTextComponent() {
137
139
  if (!this.overlayContentNode) return;
138
140
 
@@ -143,6 +145,12 @@ class RawTooltip extends BaseClass {
143
145
 
144
146
  this.overlayContentNode.appendChild(this.textComponent);
145
147
 
148
+ // An empty sr-label with role="tooltip" fails accessibility checks.
149
+ // Hide it when there's no tooltip text; vaadin handles populating it when text is present.
150
+ if (this.srLabel && !this.tooltipText) {
151
+ this.srLabel.setAttribute('aria-hidden', 'true');
152
+ }
153
+
146
154
  forwardAttrs(this, this.textComponent, {
147
155
  includeAttrs: ['readonly'],
148
156
  });
@@ -178,7 +186,15 @@ class RawTooltip extends BaseClass {
178
186
 
179
187
  #updateText(value) {
180
188
  if (!this.textComponent) return;
181
- this.textComponent.textContent = value?.trim();
189
+ const trimmedValue = (value ?? '').trim();
190
+ this.textComponent.textContent = trimmedValue;
191
+ if (this.srLabel) {
192
+ if (trimmedValue) {
193
+ this.srLabel.removeAttribute('aria-hidden');
194
+ } else {
195
+ this.srLabel.setAttribute('aria-hidden', 'true');
196
+ }
197
+ }
182
198
  }
183
199
 
184
200
  attributeChangedCallback(attrName, oldValue, newValue) {
@@ -190,7 +206,7 @@ class RawTooltip extends BaseClass {
190
206
  }
191
207
 
192
208
  if (attrName === 'opened') {
193
- this.#handleTooltipVisibility(attrName, newValue)
209
+ this.#handleTooltipVisibility();
194
210
  }
195
211
  }
196
212
  }