diff --git a/.changeset/strange-knives-study.md b/.changeset/strange-knives-study.md new file mode 100644 index 00000000000..b0588b06d82 --- /dev/null +++ b/.changeset/strange-knives-study.md @@ -0,0 +1,5 @@ +--- +'@primer/react': major +--- + +Update Details component to no longer support sx diff --git a/e2e/components/Details.test.ts b/e2e/components/Details.test.ts index e806bfe6fcc..2cbe190bc53 100644 --- a/e2e/components/Details.test.ts +++ b/e2e/components/Details.test.ts @@ -7,10 +7,6 @@ const stories: Array<{title: string; id: string}> = [ title: 'Default', id: 'components-details--default', }, - { - title: 'SX Prop Stress Test', - id: 'components-details-dev--sx-prop-stress-test', - }, ] test.describe('Details', () => { diff --git a/packages/react/src/Details/Details.dev.stories.tsx b/packages/react/src/Details/Details.dev.stories.tsx deleted file mode 100644 index f09528b1320..00000000000 --- a/packages/react/src/Details/Details.dev.stories.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import type {StoryFn, Meta} from '@storybook/react-vite' -import Details from './Details' -import {Button} from '../Button' -import useDetails from '../hooks/useDetails' - -export default { - title: 'Components/Details/Dev', - component: Details, -} as Meta - -export const SxPropStressTest: StoryFn = () => { - const {getDetailsProps} = useDetails({closeOnOutsideClick: true}) - return ( -
- - This is some content -
- ) -} diff --git a/packages/react/src/Details/Details.docs.json b/packages/react/src/Details/Details.docs.json index 4ebe3765824..f6d03f4384f 100644 --- a/packages/react/src/Details/Details.docs.json +++ b/packages/react/src/Details/Details.docs.json @@ -9,13 +9,7 @@ } ], "importPath": "@primer/react", - "props": [ - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true - } - ], + "props": [], "subcomponents": [ { "name": "Details.Summary", @@ -30,11 +24,6 @@ { "name": "children", "type": "React.ReactNode" - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ] } diff --git a/packages/react/src/Details/Details.tsx b/packages/react/src/Details/Details.tsx index d54aed4f2e2..78353ae94b8 100644 --- a/packages/react/src/Details/Details.tsx +++ b/packages/react/src/Details/Details.tsx @@ -1,9 +1,7 @@ import React, {useEffect, useState, type ComponentPropsWithoutRef, type ReactElement} from 'react' -import type {SxProp} from '../sx' import {clsx} from 'clsx' import classes from './Details.module.css' import {useMergedRefs} from '../internal/hooks/useMergedRefs' -import {BoxWithFallback} from '../internal/components/BoxWithFallback' const Root = React.forwardRef( ({className, children, ...rest}, forwardRef): ReactElement => { @@ -40,11 +38,11 @@ const Root = React.forwardRef( }, []) return ( - +
{/* Include default summary if summary is not provided */} {!hasSummary && {'See Details'}} {children} - +
) }, ) @@ -75,5 +73,5 @@ const Details = Object.assign(Root, { Summary, }) -export type DetailsProps = ComponentPropsWithoutRef<'details'> & SxProp +export type DetailsProps = ComponentPropsWithoutRef<'details'> export default Details