@primer/react 38.33.1-rc.c5a377690 → 38.34.0-rc.55c90c21a

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,10 @@
1
1
  # @primer/react
2
2
 
3
- ## 38.33.1
3
+ ## 38.34.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#8086](https://github.com/primer/react/pull/8086) [`81d4174`](https://github.com/primer/react/commit/81d4174150b37da95db23480574ddf8db5b20ca4) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Add a `hideDivider` prop to `NavList.Group` so consumers can opt out of rendering the divider before a group.
4
8
 
5
9
  ### Patch Changes
6
10
 
@@ -34,6 +34,7 @@ type NavListDividerProps = ActionListDividerProps;
34
34
  type NavListGroupProps = React.HTMLAttributes<HTMLLIElement> & {
35
35
  children: React.ReactNode;
36
36
  title?: string;
37
+ hideDivider?: boolean;
37
38
  };
38
39
  type GroupItem = {
39
40
  text: string;
@@ -375,57 +375,68 @@ Divider.displayName = "NavList.Divider";
375
375
  const TrailingAction = ActionList.TrailingAction;
376
376
  TrailingAction.displayName = "NavList.TrailingAction";
377
377
  const Group = (t0) => {
378
- const $ = c(14);
378
+ const $ = c(19);
379
379
  let children;
380
+ let hideDivider;
380
381
  let props;
381
382
  let title;
382
383
  if ($[0] !== t0) {
383
- ({title, children, ...props} = t0);
384
+ ({title, children, hideDivider, ...props} = t0);
384
385
  $[0] = t0;
385
386
  $[1] = children;
386
- $[2] = props;
387
- $[3] = title;
387
+ $[2] = hideDivider;
388
+ $[3] = props;
389
+ $[4] = title;
388
390
  } else {
389
391
  children = $[1];
390
- props = $[2];
391
- title = $[3];
392
+ hideDivider = $[2];
393
+ props = $[3];
394
+ title = $[4];
392
395
  }
393
396
  const headingLevel = React.useContext(NavListHeadingLevelContext);
394
397
  let t1;
395
- if ($[4] !== headingLevel) {
398
+ if ($[5] !== headingLevel) {
396
399
  t1 = headingLevel ? levelToHeadingTag(headingLevel + 1) : "h3";
397
- $[4] = headingLevel;
398
- $[5] = t1;
399
- } else t1 = $[5];
400
+ $[5] = headingLevel;
401
+ $[6] = t1;
402
+ } else t1 = $[6];
400
403
  const groupHeadingAs = t1;
401
404
  let t2;
402
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
403
- t2 = /*#__PURE__*/ jsx(ActionList.Divider, {});
404
- $[6] = t2;
405
- } else t2 = $[6];
405
+ if ($[7] !== hideDivider) {
406
+ t2 = !hideDivider && /*#__PURE__*/ jsx(ActionList.Divider, {});
407
+ $[7] = hideDivider;
408
+ $[8] = t2;
409
+ } else t2 = $[8];
406
410
  let t3;
407
- if ($[7] !== groupHeadingAs || $[8] !== title) {
411
+ if ($[9] !== groupHeadingAs || $[10] !== title) {
408
412
  t3 = title ? /*#__PURE__*/ jsx(ActionList.GroupHeading, {
409
413
  as: groupHeadingAs,
410
414
  "data-component": "ActionList.GroupHeading",
411
415
  children: title
412
416
  }) : null;
413
- $[7] = groupHeadingAs;
414
- $[8] = title;
415
- $[9] = t3;
416
- } else t3 = $[9];
417
+ $[9] = groupHeadingAs;
418
+ $[10] = title;
419
+ $[11] = t3;
420
+ } else t3 = $[11];
417
421
  let t4;
418
- if ($[10] !== children || $[11] !== props || $[12] !== t3) {
419
- t4 = /*#__PURE__*/ jsxs(Fragment, { children: [t2, /*#__PURE__*/ jsxs(ActionList.Group, {
422
+ if ($[12] !== children || $[13] !== props || $[14] !== t3) {
423
+ t4 = /*#__PURE__*/ jsxs(ActionList.Group, {
420
424
  ...props,
421
425
  children: [t3, children]
422
- })] });
423
- $[10] = children;
424
- $[11] = props;
425
- $[12] = t3;
426
- $[13] = t4;
427
- } else t4 = $[13];
428
- return t4;
426
+ });
427
+ $[12] = children;
428
+ $[13] = props;
429
+ $[14] = t3;
430
+ $[15] = t4;
431
+ } else t4 = $[15];
432
+ let t5;
433
+ if ($[16] !== t2 || $[17] !== t4) {
434
+ t5 = /*#__PURE__*/ jsxs(Fragment, { children: [t2, t4] });
435
+ $[16] = t2;
436
+ $[17] = t4;
437
+ $[18] = t5;
438
+ } else t5 = $[18];
439
+ return t5;
429
440
  };
430
441
  const GroupExpand = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
431
442
  const $ = c(23);
@@ -4341,6 +4341,12 @@
4341
4341
  "type": "string",
4342
4342
  "description": "The text that gets rendered as the group's heading. Alternatively, you can pass the `NavList.GroupHeading` component as a child of `NavList.Group`.\nIf both `title` and `NavList.GroupHeading` are passed, `NavList.GroupHeading` will be rendered as the heading."
4343
4343
  },
4344
+ {
4345
+ "name": "hideDivider",
4346
+ "type": "boolean",
4347
+ "defaultValue": "false",
4348
+ "description": "Whether to hide the divider that is rendered before the group."
4349
+ },
4344
4350
  {
4345
4351
  "name": "ref",
4346
4352
  "type": "React.RefObject<HTMLElement>"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "38.33.1-rc.c5a377690",
4
+ "version": "38.34.0-rc.55c90c21a",
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",