@primer/react 0.0.0-20260225173407 → 0.0.0-20260225182427

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +1 -3
  2. package/dist/TooltipV2/Tooltip.js +35 -35
  3. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +2 -0
  4. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +1 -0
  5. package/dist/UnderlineNav/UnderlineNav.d.ts +2 -0
  6. package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  7. package/dist/UnderlineNav/UnderlineNav.js +288 -395
  8. package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
  9. package/dist/UnderlineNav/UnderlineNavContext.d.ts +11 -1
  10. package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
  11. package/dist/UnderlineNav/UnderlineNavContext.js +4 -1
  12. package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css +2 -0
  13. package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css.map +1 -0
  14. package/dist/UnderlineNav/UnderlineNavItem.d.ts +0 -4
  15. package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
  16. package/dist/UnderlineNav/UnderlineNavItem.js +23 -8
  17. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -1
  18. package/dist/UnderlineNav/styles.d.ts +16 -0
  19. package/dist/UnderlineNav/styles.d.ts.map +1 -0
  20. package/dist/UnderlineNav/styles.js +19 -0
  21. package/dist/UnderlineNav/types.d.ts +5 -0
  22. package/dist/UnderlineNav/types.d.ts.map +1 -1
  23. package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css +2 -0
  24. package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css.map +1 -0
  25. package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -1
  26. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +2 -0
  27. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +1 -0
  28. package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
  29. package/dist/internal/components/UnderlineTabbedInterface.js +69 -83
  30. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
  31. package/package.json +1 -1
  32. package/dist/UnderlineNav/UnderlineNav-9d1ce906.css +0 -2
  33. package/dist/UnderlineNav/UnderlineNav-9d1ce906.css.map +0 -1
  34. package/dist/UnderlineNav/UnderlineNavItem-86b7d4b2.css +0 -2
  35. package/dist/UnderlineNav/UnderlineNavItem-86b7d4b2.css.map +0 -1
  36. package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css +0 -2
  37. package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css.map +0 -1
  38. package/dist/internal/components/UnderlineTabbedInterface-e91b4f85.css +0 -2
  39. package/dist/internal/components/UnderlineTabbedInterface-e91b4f85.css.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260225173407
3
+ ## 0.0.0-20260225182427
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -24,8 +24,6 @@
24
24
 
25
25
  - [#7571](https://github.com/primer/react/pull/7571) [`59ab235`](https://github.com/primer/react/commit/59ab235cb8089442652daca33746b11cea3e6a5f) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - AnchoredOverlay: changed `overflow` from `hidden` to `auto` to prevent content clipping at small viewports.
26
26
 
27
- - [#7541](https://github.com/primer/react/pull/7541) [`20c3ca5`](https://github.com/primer/react/commit/20c3ca5e573045c5407ef1b2b571f5c550a182c5) Thanks [@hectahertz](https://github.com/hectahertz)! - Improve UnderlineNav overflow performance by replacing synchronous DOM measurements with CSS `overflow: hidden` + `IntersectionObserver`
28
-
29
27
  - [#7553](https://github.com/primer/react/pull/7553) [`6225ba2`](https://github.com/primer/react/commit/6225ba231cfdbe6ef7fa41dd62734d5a970bdc7d) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useRefObjectAsForwardedRef): add dependency array to useImperativeHandle
30
28
 
31
29
  ## 38.13.0
@@ -199,7 +199,41 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
199
199
  return /*#__PURE__*/jsx(TooltipContext.Provider, {
200
200
  value: value,
201
201
  children: /*#__PURE__*/jsxs(Fragment, {
202
- children: [/*#__PURE__*/React.isValidElement(child) &&
202
+ children: [/*#__PURE__*/jsx("span", {
203
+ className: clsx(className, classes.Tooltip),
204
+ ref: tooltipElRef,
205
+ "data-direction": calculatedDirection,
206
+ ...rest,
207
+ // Only need tooltip role if the tooltip is a description for supplementary information
208
+ role: type === 'description' ? 'tooltip' : undefined
209
+ // stop AT from announcing the tooltip twice: when it is a label type it will be announced with "aria-labelledby",when it is a description type it will be announced with "aria-describedby"
210
+ ,
211
+ "aria-hidden": true
212
+ // mouse leave and enter on the tooltip itself is needed to keep the tooltip open when the mouse is over the tooltip
213
+ ,
214
+ onMouseEnter: openTooltip,
215
+ onMouseLeave: closeTooltip
216
+ // If there is an aria-label prop, always assign the ID to the parent so the accessible label can be overridden
217
+ ,
218
+ id: hasAriaLabel || !keybindingHint ? tooltipId : undefined,
219
+ children: keybindingHint ? /*#__PURE__*/jsxs(Fragment, {
220
+ children: [/*#__PURE__*/jsxs("span", {
221
+ id: hasAriaLabel ? undefined : tooltipId,
222
+ children: [text, /*#__PURE__*/jsxs(VisuallyHidden, {
223
+ children: ["(", getAccessibleKeybindingHintString(keybindingHint, isMacOS), ")"]
224
+ })]
225
+ }), /*#__PURE__*/jsx("span", {
226
+ className: clsx(classes.KeybindingHintContainer, text && classes.HasTextBefore),
227
+ "aria-hidden": true,
228
+ children: /*#__PURE__*/jsx(KeybindingHint, {
229
+ keys: keybindingHint,
230
+ format: "condensed",
231
+ variant: "onEmphasis",
232
+ size: "small"
233
+ })
234
+ })]
235
+ }) : text
236
+ }), /*#__PURE__*/React.isValidElement(child) &&
203
237
  /*#__PURE__*/
204
238
  // eslint-disable-next-line react-hooks/refs
205
239
  React.cloneElement(child, {
@@ -267,40 +301,6 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
267
301
  closeTooltip();
268
302
  (_child$props$onMouseL = (_child$props5 = child.props).onMouseLeave) === null || _child$props$onMouseL === void 0 ? void 0 : _child$props$onMouseL.call(_child$props5, event);
269
303
  }
270
- }), /*#__PURE__*/jsx("span", {
271
- className: clsx(className, classes.Tooltip),
272
- ref: tooltipElRef,
273
- "data-direction": calculatedDirection,
274
- ...rest,
275
- // Only need tooltip role if the tooltip is a description for supplementary information
276
- role: type === 'description' ? 'tooltip' : undefined
277
- // stop AT from announcing the tooltip twice: when it is a label type it will be announced with "aria-labelledby",when it is a description type it will be announced with "aria-describedby"
278
- ,
279
- "aria-hidden": true
280
- // mouse leave and enter on the tooltip itself is needed to keep the tooltip open when the mouse is over the tooltip
281
- ,
282
- onMouseEnter: openTooltip,
283
- onMouseLeave: closeTooltip
284
- // If there is an aria-label prop, always assign the ID to the parent so the accessible label can be overridden
285
- ,
286
- id: hasAriaLabel || !keybindingHint ? tooltipId : undefined,
287
- children: keybindingHint ? /*#__PURE__*/jsxs(Fragment, {
288
- children: [/*#__PURE__*/jsxs("span", {
289
- id: hasAriaLabel ? undefined : tooltipId,
290
- children: [text, /*#__PURE__*/jsxs(VisuallyHidden, {
291
- children: ["(", getAccessibleKeybindingHintString(keybindingHint, isMacOS), ")"]
292
- })]
293
- }), /*#__PURE__*/jsx("span", {
294
- className: clsx(classes.KeybindingHintContainer, text && classes.HasTextBefore),
295
- "aria-hidden": true,
296
- children: /*#__PURE__*/jsx(KeybindingHint, {
297
- keys: keybindingHint,
298
- format: "condensed",
299
- variant: "onEmphasis",
300
- size: "small"
301
- })
302
- })]
303
- }) : text
304
304
  })]
305
305
  })
306
306
  });
@@ -0,0 +1,2 @@
1
+ .prc-UnderlineNav-MenuItemContent-3J7gB{align-items:center;display:flex;justify-content:space-between}.prc-UnderlineNav-MoreButton-Y8soj{background:transparent;border:0;box-shadow:none;font-weight:var(--base-text-weight-normal,400);margin:0;padding:var(--base-size-4,.25rem) var(--base-size-8,.5rem)}.prc-UnderlineNav-MoreButton-Y8soj>[data-component=trailingVisual]{margin-left:0}
2
+ /*# sourceMappingURL=UnderlineNav-4344d9b0.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/UnderlineNav/UnderlineNav.module.css.js"],"names":[],"mappings":"AAAA,wCAEE,kBAAmB,CADnB,YAAa,CAEb,6BACF,CAGA,mCAGE,sBAAuB,CADvB,QAAS,CAGT,eAAgB,CADhB,8CAA2C,CAH3C,QAAS,CAQT,0DAKF,CAHE,mEACE,aACF","file":"UnderlineNav-4344d9b0.css","sourcesContent":[".MenuItemContent {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n/* More button styles migrated from styles.ts (was moreBtnStyles) */\n.MoreButton {\n margin: 0; /* reset Safari extra margin */\n border: 0;\n background: transparent;\n font-weight: var(--base-text-weight-normal);\n box-shadow: none;\n padding-top: var(--base-size-4);\n padding-bottom: var(--base-size-4);\n padding-left: var(--base-size-8);\n padding-right: var(--base-size-8);\n\n & > [data-component='trailingVisual'] {\n margin-left: 0;\n }\n}\n"]}
@@ -15,5 +15,7 @@ export type UnderlineNavProps = {
15
15
  */
16
16
  variant?: 'inset' | 'flush';
17
17
  };
18
+ export declare const MORE_BTN_WIDTH = 86;
19
+ export declare const getValidChildren: (children: React.ReactNode) => React.ReactElement<any>[];
18
20
  export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<unknown>>;
19
21
  //# sourceMappingURL=UnderlineNav.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAe1F,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC5B,CAAA;AAiRD,eAAO,MAAM,YAAY,mFA4PxB,CAAA"}
1
+ {"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6D,MAAM,OAAO,CAAA;AAmBjF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,cAAc,KAAK,CAAA;AAwEhC,eAAO,MAAM,gBAAgB,GAAI,UAAU,KAAK,CAAC,SAAS,KAEgC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAChH,CAAA;AAgCD,eAAO,MAAM,YAAY,mFA8SxB,CAAA"}