Skip to content

Commit f8fb16a

Browse files
committed
remove sx support from LabelGroup.tsx
1 parent 21030b3 commit f8fb16a

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

packages/react/src/LabelGroup/LabelGroup.tsx

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ import {getFocusableChild} from '@primer/behaviors/utils'
55
import {get} from '../constants'
66
import VisuallyHidden from '../_VisuallyHidden'
77
import {AnchoredOverlay} from '../AnchoredOverlay'
8-
import Box from '../Box'
98
import {Button, IconButton} from '../Button'
109
import {useTheme} from '../ThemeProvider'
11-
import type {SxProp} from '../sx'
12-
import sx from '../sx'
1310

1411
export type LabelGroupProps = {
1512
/** Customize the element type of the rendered container */
@@ -19,9 +16,9 @@ export type LabelGroupProps = {
1916
/** 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. */
2017
visibleChildCount?: 'auto' | number
2118
className?: string
22-
} & SxProp
19+
}
2320

24-
const StyledLabelGroupContainer = styled.div<SxProp>`
21+
const StyledLabelGroupContainer = styled.div`
2522
display: flex;
2623
flex-wrap: nowrap;
2724
gap: ${get('space.1')};
@@ -39,8 +36,6 @@ const StyledLabelGroupContainer = styled.div<SxProp>`
3936
margin-block-end: 0;
4037
list-style-type: none;
4138
}
42-
43-
${sx};
4439
`
4540

4641
const ItemWrapper = styled.div`
@@ -137,18 +132,16 @@ const OverlayToggle: React.FC<
137132
)}
138133
focusZoneSettings={{disabled: true}}
139134
>
140-
<Box alignItems="flex-start" display="flex" width={overlayWidth} padding={`${overlayPaddingPx}px`}>
141-
<Box display="flex" flexWrap="wrap" sx={{gap: 1}}>
142-
{children}
143-
</Box>
135+
<div style={{alignItems: 'flex-start', display: 'flex', width: overlayWidth, padding: `${overlayPaddingPx}px`}}>
136+
<div style={{display: 'flex', flexWrap: 'wrap', gap: '4px'}}>{children}</div>
144137
<IconButton
145138
onClick={closeOverflowOverlay}
146139
icon={XIcon}
147140
aria-label="Close"
148141
variant="invisible"
149-
sx={{flexShrink: 0}}
142+
style={{flexShrink: 0}}
150143
/>
151-
</Box>
144+
</div>
152145
</AnchoredOverlay>
153146
) : null
154147

@@ -157,7 +150,6 @@ const LabelGroup: React.FC<React.PropsWithChildren<LabelGroupProps>> = ({
157150
children,
158151
visibleChildCount,
159152
overflowStyle = 'overlay',
160-
sx: sxProp,
161153
as = 'ul',
162154
className,
163155
}) => {
@@ -338,7 +330,6 @@ const LabelGroup: React.FC<React.PropsWithChildren<LabelGroupProps>> = ({
338330
ref={containerRef}
339331
data-overflow={overflowStyle === 'inline' && isOverflowShown ? 'inline' : undefined}
340332
data-list={isList || undefined}
341-
sx={sxProp}
342333
className={className}
343334
as={as}
344335
>
@@ -381,13 +372,7 @@ const LabelGroup: React.FC<React.PropsWithChildren<LabelGroupProps>> = ({
381372
</ToggleWrapper>
382373
</StyledLabelGroupContainer>
383374
) : (
384-
<StyledLabelGroupContainer
385-
data-overflow="inline"
386-
data-list={isList || undefined}
387-
sx={sxProp}
388-
as={as}
389-
className={className}
390-
>
375+
<StyledLabelGroupContainer data-overflow="inline" data-list={isList || undefined} as={as} className={className}>
391376
{isList
392377
? React.Children.map(children, (child, index) => {
393378
return <li key={index}>{child}</li>

0 commit comments

Comments
 (0)