Skip to content

Commit 150e0fc

Browse files
committed
remove sx from ActionList/Visuals and update styled-react exports
1 parent 543f7aa commit 150e0fc

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/react/src/ActionList/Visuals.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import React from 'react'
22
import {AlertIcon} from '@primer/octicons-react'
33
import Spinner from '../Spinner'
4-
import type {SxProp} from '../sx'
54
import {ItemContext} from './shared'
65
import {Tooltip, type TooltipProps} from '../TooltipV2'
76
import {clsx} from 'clsx'
87
import classes from './ActionList.module.css'
9-
import {BoxWithFallback} from '../internal/components/BoxWithFallback'
108

11-
export type VisualProps = SxProp & React.HTMLAttributes<HTMLSpanElement>
9+
export type VisualProps = React.HTMLAttributes<HTMLSpanElement>
1210

1311
export const VisualContainer: React.FC<React.PropsWithChildren<VisualProps>> = ({className, ...props}) => {
14-
return <BoxWithFallback as="span" className={clsx(className, classes.VisualWrap)} {...props} />
12+
return <span className={clsx(className, classes.VisualWrap)} {...props} />
1513
}
1614

1715
export type ActionListLeadingVisualProps = VisualProps

packages/styled-react/src/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import {
2+
ActionList as PrimerActionList,
3+
type ActionListProps as PrimerActionListProps,
24
type BetterSystemStyleObject,
35
Box,
46
type BoxProps,
@@ -68,6 +70,14 @@ type StyledProps = SxProp &
6870
PositionProps &
6971
ShadowProps
7072

73+
type ActionListProps = PrimerActionListProps & SxProp
74+
75+
const ActionList: ForwardRefComponent<'div', ActionListProps> = styled(PrimerActionList).withConfig<ActionListProps>({
76+
shouldForwardProp: prop => prop !== 'sx',
77+
})`
78+
${sx}
79+
`
80+
7181
type SpinnerProps = PrimerSpinnerProps & SxProp
7282

7383
function Spinner(props: SpinnerProps) {
@@ -257,6 +267,7 @@ export {Header, type HeaderProps} from './components/Header'
257267
export {Flash} from './components/Flash'
258268

259269
export {
270+
ActionList,
260271
Checkbox,
261272
CounterLabel,
262273
LinkButton,
@@ -274,7 +285,6 @@ export {
274285
}
275286

276287
export {
277-
ActionList,
278288
ActionMenu,
279289
Autocomplete,
280290
Avatar,

0 commit comments

Comments
 (0)