@coinbase/cds-web 8.57.0 → 8.57.1

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
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 8.57.1 (3/24/2026 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Use aria-describedby for all tooltip's triggers. [[#541](https://github.com/coinbase/cds/pull/541)]
16
+
11
17
  ## 8.57.0 (3/24/2026 PST)
12
18
 
13
19
  #### 🚀 Updates
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/overlays/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQnD,eAAO,MAAM,OAAO,GAAI,+SAqBrB,YAAY,4CAoFd,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/overlays/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQnD,eAAO,MAAM,OAAO,GAAI,+SAqBrB,YAAY,4CA8Ed,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipContent.d.ts","sourceRoot":"","sources":["../../../src/overlays/tooltip/TooltipContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAmCzD,eAAO,MAAM,cAAc;;;wJAgD1B,CAAC"}
1
+ {"version":3,"file":"TooltipContent.d.ts","sourceRoot":"","sources":["../../../src/overlays/tooltip/TooltipContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAmCzD,eAAO,MAAM,cAAc;;;wJAkD1B,CAAC"}
@@ -51,19 +51,13 @@ export const Tooltip = _ref => {
51
51
  }
52
52
  }, [handleOnMouseEnter]);
53
53
  const clonedChild = useMemo(() => {
54
- const isStringContent = typeof content === 'string';
55
- return /*#__PURE__*/cloneElement(children,
56
- // String content: Use only aria-label so the trigger is announced on focus without
57
- // double announcement (aria-describedby would point to the same text when the tooltip is open).
58
- // Non-string content: Use only aria-describedby to associate the visible tooltip (id=tooltipId).
59
- // We cannot use aria-label here (it accepts only strings). May not announce on focus for
60
- // non-button triggers due to timing (describedby target mounts when tooltip opens).
61
- isStringContent ? {
62
- 'aria-label': content
63
- } : {
54
+ // Use aria-describedby to associate the tooltip (role="tooltip") with the trigger.
55
+ // This preserves the trigger's own accessible name (e.g. button text) while the tooltip
56
+ // provides supplemental description, per the ARIA tooltip pattern.
57
+ return /*#__PURE__*/cloneElement(children, {
64
58
  'aria-describedby': tooltipId
65
59
  });
66
- }, [children, content, tooltipId]);
60
+ }, [children, tooltipId]);
67
61
  const contentPosition = useMemo(() => ({
68
62
  placement
69
63
  }), [placement]);
@@ -46,17 +46,17 @@ export const TooltipContent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, r
46
46
  borderRadius: 200,
47
47
  "data-testid": testID,
48
48
  elevation: elevation,
49
+ id: tooltipId,
49
50
  maxWidth: tooltipMaxWidth,
50
51
  paddingX: tooltipPaddingX,
51
52
  paddingY: tooltipPaddingY,
53
+ role: "tooltip",
52
54
  children: typeof content === 'string' ? /*#__PURE__*/_jsx(Text, {
53
55
  className: textCss,
54
56
  color: "fg",
55
57
  font: "label2",
56
- id: tooltipId,
57
58
  children: content
58
59
  }) : /*#__PURE__*/_jsx("div", {
59
- id: tooltipId,
60
60
  children: content
61
61
  })
62
62
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-web",
3
- "version": "8.57.0",
3
+ "version": "8.57.1",
4
4
  "description": "Coinbase Design System - Web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -207,7 +207,7 @@
207
207
  "react-dom": "^18.3.1"
208
208
  },
209
209
  "dependencies": {
210
- "@coinbase/cds-common": "^8.57.0",
210
+ "@coinbase/cds-common": "^8.57.1",
211
211
  "@coinbase/cds-icons": "^5.13.0",
212
212
  "@coinbase/cds-illustrations": "^4.35.0",
213
213
  "@coinbase/cds-lottie-files": "^3.3.4",