@primer/react 0.0.0-20260302220808 → 0.0.0-20260303012527

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
@@ -1,6 +1,6 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260302220808
3
+ ## 0.0.0-20260303012527
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -24,34 +24,31 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
24
24
  * For non-button-semantic items, renders children directly.
25
25
  */
26
26
  function ConditionalTooltip(t0) {
27
- const $ = c(4);
27
+ const $ = c(3);
28
28
  const {
29
29
  text,
30
30
  enabled,
31
31
  children
32
32
  } = t0;
33
- if (!enabled) {
33
+ if (!enabled || !text) {
34
34
  return children;
35
35
  }
36
36
  const t1 = text || "";
37
- const t2 = !text;
38
- let t3;
39
- if ($[0] !== children || $[1] !== t1 || $[2] !== t2) {
40
- t3 = /*#__PURE__*/jsx(Tooltip, {
37
+ let t2;
38
+ if ($[0] !== children || $[1] !== t1) {
39
+ t2 = /*#__PURE__*/jsx(Tooltip, {
41
40
  text: t1,
42
41
  direction: "e",
43
42
  delay: "medium",
44
- _privateDisableTooltip: t2,
45
43
  children: children
46
44
  });
47
45
  $[0] = children;
48
46
  $[1] = t1;
49
47
  $[2] = t2;
50
- $[3] = t3;
51
48
  } else {
52
- t3 = $[3];
49
+ t2 = $[2];
53
50
  }
54
- return t3;
51
+ return t2;
55
52
  }
56
53
  const SubItem = t0 => {
57
54
  const $ = c(2);
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/TooltipV2/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiD,KAAK,yBAAyB,EAAC,MAAM,OAAO,CAAA;AAS3G,OAAO,EAAoD,KAAK,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AAG7G,OAAO,KAAK,EAAC,UAAU,E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,iBAAiB,CAAC;IACjD,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,GAAG,aAAa,CAAA;IAC9B,cAAc,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAA;IAC5C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IACnC;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC,CAAC,GACA,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AAiEnC,eAAO,MAAM,cAAc;gBAAoC,MAAM;EAAM,CAAA;AAE3E,eAAO,MAAM,OAAO,EAAE,yBAAyB,CAC7C,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CACvE,GACC,UAsRD,CAAA"}
@@ -212,6 +212,12 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
212
212
  return child.props['aria-describedby'];
213
213
  }
214
214
 
215
+ // When the tooltip is disabled, don't add its ID to aria-describedby
216
+ // to avoid an empty string polluting the accessible description
217
+ if (_privateDisableTooltip) {
218
+ return child.props['aria-describedby'];
219
+ }
220
+
215
221
  // If tooltip is a description type, append our tooltipId
216
222
  const existingDescribedBy = child.props['aria-describedby'];
217
223
  if (existingDescribedBy) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260302220808",
4
+ "version": "0.0.0-20260303012527",
5
5
  "description": "An implementation of GitHub's Primer Design System using React",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",