From f8fb16a79daace5e2b2a8422de3be382a034899a Mon Sep 17 00:00:00 2001 From: llastflowers Date: Wed, 27 Aug 2025 12:20:45 -0700 Subject: [PATCH 1/2] remove sx support from LabelGroup.tsx --- packages/react/src/LabelGroup/LabelGroup.tsx | 29 +++++--------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/packages/react/src/LabelGroup/LabelGroup.tsx b/packages/react/src/LabelGroup/LabelGroup.tsx index 65b5d257635..54b3d184c42 100644 --- a/packages/react/src/LabelGroup/LabelGroup.tsx +++ b/packages/react/src/LabelGroup/LabelGroup.tsx @@ -5,11 +5,8 @@ import {getFocusableChild} from '@primer/behaviors/utils' import {get} from '../constants' import VisuallyHidden from '../_VisuallyHidden' import {AnchoredOverlay} from '../AnchoredOverlay' -import Box from '../Box' import {Button, IconButton} from '../Button' import {useTheme} from '../ThemeProvider' -import type {SxProp} from '../sx' -import sx from '../sx' export type LabelGroupProps = { /** Customize the element type of the rendered container */ @@ -19,9 +16,9 @@ export type LabelGroupProps = { /** How many tokens to show. `'auto'` truncates the tokens to fit in the parent container. Passing a number will truncate after that number tokens. If this is undefined, tokens will never be truncated. */ visibleChildCount?: 'auto' | number className?: string -} & SxProp +} -const StyledLabelGroupContainer = styled.div` +const StyledLabelGroupContainer = styled.div` display: flex; flex-wrap: nowrap; gap: ${get('space.1')}; @@ -39,8 +36,6 @@ const StyledLabelGroupContainer = styled.div` margin-block-end: 0; list-style-type: none; } - - ${sx}; ` const ItemWrapper = styled.div` @@ -137,18 +132,16 @@ const OverlayToggle: React.FC< )} focusZoneSettings={{disabled: true}} > - - - {children} - +
+
{children}
- +
) : null @@ -157,7 +150,6 @@ const LabelGroup: React.FC> = ({ children, visibleChildCount, overflowStyle = 'overlay', - sx: sxProp, as = 'ul', className, }) => { @@ -338,7 +330,6 @@ const LabelGroup: React.FC> = ({ ref={containerRef} data-overflow={overflowStyle === 'inline' && isOverflowShown ? 'inline' : undefined} data-list={isList || undefined} - sx={sxProp} className={className} as={as} > @@ -381,13 +372,7 @@ const LabelGroup: React.FC> = ({ ) : ( - + {isList ? React.Children.map(children, (child, index) => { return
  • {child}
  • From da0bd7759067cedb3fc1ca7109a966c0e6bc66b2 Mon Sep 17 00:00:00 2001 From: "Brittany L. Houtz" <55068883+llastflowers@users.noreply.github.com> Date: Wed, 27 Aug 2025 12:27:30 -0700 Subject: [PATCH 2/2] Update LabelGroup to remove sx support --- .changeset/seven-coats-hang.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/seven-coats-hang.md diff --git a/.changeset/seven-coats-hang.md b/.changeset/seven-coats-hang.md new file mode 100644 index 00000000000..ea7e6ec209e --- /dev/null +++ b/.changeset/seven-coats-hang.md @@ -0,0 +1,6 @@ + +--- +'@primer/react': major +--- + +Update LabelGroup component to no longer support sx