Skip to content

Commit 5c30443

Browse files
authored
Remove support for sx from Details component (#6680)
1 parent 17bd85a commit 5c30443

File tree

5 files changed

+9
-47
lines changed

5 files changed

+9
-47
lines changed

.changeset/strange-knives-study.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+
Update Details component to no longer support sx

e2e/components/Details.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ const stories: Array<{title: string; id: string}> = [
77
title: 'Default',
88
id: 'components-details--default',
99
},
10-
{
11-
title: 'SX Prop Stress Test',
12-
id: 'components-details-dev--sx-prop-stress-test',
13-
},
1410
]
1511

1612
test.describe('Details', () => {

packages/react/src/Details/Details.dev.stories.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/react/src/Details/Details.docs.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@
99
}
1010
],
1111
"importPath": "@primer/react",
12-
"props": [
13-
{
14-
"name": "sx",
15-
"type": "SystemStyleObject",
16-
"deprecated": true
17-
}
18-
],
12+
"props": [],
1913
"subcomponents": [
2014
{
2115
"name": "Details.Summary",
@@ -30,11 +24,6 @@
3024
{
3125
"name": "children",
3226
"type": "React.ReactNode"
33-
},
34-
{
35-
"name": "sx",
36-
"type": "SystemStyleObject",
37-
"deprecated": true
3827
}
3928
]
4029
}

packages/react/src/Details/Details.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React, {useEffect, useState, type ComponentPropsWithoutRef, type ReactElement} from 'react'
2-
import type {SxProp} from '../sx'
32
import {clsx} from 'clsx'
43
import classes from './Details.module.css'
54
import {useMergedRefs} from '../internal/hooks/useMergedRefs'
6-
import {BoxWithFallback} from '../internal/components/BoxWithFallback'
75

86
const Root = React.forwardRef<HTMLDetailsElement, DetailsProps>(
97
({className, children, ...rest}, forwardRef): ReactElement => {
@@ -40,11 +38,11 @@ const Root = React.forwardRef<HTMLDetailsElement, DetailsProps>(
4038
}, [])
4139

4240
return (
43-
<BoxWithFallback as="details" className={clsx(className, classes.Details)} {...rest} ref={ref}>
41+
<details className={clsx(className, classes.Details)} {...rest} ref={ref}>
4442
{/* Include default summary if summary is not provided */}
4543
{!hasSummary && <Details.Summary data-default-summary>{'See Details'}</Details.Summary>}
4644
{children}
47-
</BoxWithFallback>
45+
</details>
4846
)
4947
},
5048
)
@@ -75,5 +73,5 @@ const Details = Object.assign(Root, {
7573
Summary,
7674
})
7775

78-
export type DetailsProps = ComponentPropsWithoutRef<'details'> & SxProp
76+
export type DetailsProps = ComponentPropsWithoutRef<'details'>
7977
export default Details

0 commit comments

Comments
 (0)