Skip to content

Commit 133d5a5

Browse files
authored
chore(VisuallyHidden): Remove sx prop support and refactor VisuallyHidden component (#6607)
1 parent 2fa4f16 commit 133d5a5

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.changeset/icy-pianos-say.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': major
3+
---
4+
5+
Remove sx prop support from the VisuallyHidden component

packages/react/src/VisuallyHidden/VisuallyHidden.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import type {SxProp} from '../sx'
21
import {clsx} from 'clsx'
32
import type React from 'react'
43
import {type HTMLAttributes} from 'react'
54
import classes from './VisuallyHidden.module.css'
6-
import {BoxWithFallback} from '../internal/components/BoxWithFallback'
75

86
/**
97
* Provides a component that implements the "visually hidden" technique. This is
@@ -17,14 +15,14 @@ import {BoxWithFallback} from '../internal/components/BoxWithFallback'
1715
*/
1816
export const VisuallyHidden = ({className, children, ...rest}: VisuallyHiddenProps) => {
1917
return (
20-
<BoxWithFallback as="span" className={clsx(className, classes.VisuallyHidden)} {...rest}>
18+
<span className={clsx(className, classes.VisuallyHidden)} {...rest}>
2119
{children}
22-
</BoxWithFallback>
20+
</span>
2321
)
2422
}
2523

2624
export type VisuallyHiddenProps = React.PropsWithChildren<
2725
HTMLAttributes<HTMLSpanElement> & {
2826
className?: string
29-
} & SxProp
27+
}
3028
>

0 commit comments

Comments
 (0)