Skip to content

Commit 2edb05a

Browse files
Copilotjonrohan
andauthored
Remove PageHeader from @primer/styled-react (#7726)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com> Co-authored-by: Jon Rohan <yes@jonrohan.codes>
1 parent f5f2869 commit 2edb05a

File tree

7 files changed

+6
-194
lines changed

7 files changed

+6
-194
lines changed

.changeset/warm-spoons-own.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/styled-react": patch
3+
---
4+
5+
Remove PageHeader from @primer/styled-react

packages/styled-react/src/__tests__/__snapshots__/exports.test.ts.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ exports[`@primer/styled-react exports 1`] = `
2121
"LinkButton",
2222
"merge",
2323
"Overlay",
24-
"PageHeader",
2524
"SegmentedControl",
2625
"Spinner",
2726
"sx",
@@ -54,7 +53,6 @@ exports[`@primer/styled-react/deprecated exports 1`] = `
5453
exports[`@primer/styled-react/experimental exports 1`] = `
5554
[
5655
"Dialog",
57-
"PageHeader",
5856
"Table",
5957
"Tooltip",
6058
]

packages/styled-react/src/__tests__/primer-react-experimental.browser.test.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import {render, screen} from '@testing-library/react'
22
import {describe, expect, test} from 'vitest'
3-
import {Dialog, PageHeader, Table, Tooltip} from '../experimental'
3+
import {Dialog, Table, Tooltip} from '../experimental'
44

55
describe('@primer/react/experimental', () => {
66
test('Dialog supports `sx` prop', () => {
77
render(<Dialog data-testid="component" onClose={() => {}} sx={{background: 'red'}} />)
88
expect(window.getComputedStyle(screen.getByRole('dialog')).backgroundColor).toBe('rgb(255, 0, 0)')
99
})
1010

11-
test('PageHeader supports `sx` prop', () => {
12-
const {container} = render(<PageHeader as="div" data-testid="component" sx={{background: 'red'}} role="article" />)
13-
expect(container.firstElementChild!).toHaveAttribute('role', 'article')
14-
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
15-
})
16-
1711
test('Table.Container', () => {
1812
render(<Table.Container data-testid="component" sx={{background: 'red'}} />)
1913
expect(window.getComputedStyle(screen.getByTestId('component')).backgroundColor).toBe('rgb(255, 0, 0)')

packages/styled-react/src/__tests__/primer-react.browser.test.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
Link,
2020
LinkButton,
2121
Overlay,
22-
PageHeader,
2322
SegmentedControl,
2423
Spinner,
2524
Text,
@@ -197,22 +196,6 @@ describe('@primer/react', () => {
197196
expect(screen.getByTestId('component')).toHaveAttribute('role', 'dialog')
198197
})
199198

200-
test('PageHeader supports `sx` prop', () => {
201-
const {container} = render(<PageHeader as="div" data-testid="component" sx={{background: 'red'}} role="article" />)
202-
expect(container.firstElementChild!).toHaveAttribute('role', 'article')
203-
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
204-
})
205-
206-
test('PageHeader.Actions supports `sx` prop', () => {
207-
const {container} = render(<PageHeader.Actions data-testid="component" sx={{background: 'red'}} />)
208-
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
209-
})
210-
211-
test('PageHeader.Title supports `sx` prop', () => {
212-
const {container} = render(<PageHeader.Title data-testid="component" sx={{background: 'red'}} />)
213-
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
214-
})
215-
216199
test('SegmentedControl supports `sx` prop', () => {
217200
render(<SegmentedControl data-testid="component" sx={{background: 'red'}} />)
218201
expect(window.getComputedStyle(screen.getByTestId('component')).backgroundColor).toBe('rgb(255, 0, 0)')

packages/styled-react/src/components/PageHeader.tsx

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

packages/styled-react/src/experimental.tsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,6 @@ export {
1212
type DialogProps,
1313
} from './components/Dialog'
1414

15-
export {
16-
/**
17-
* @deprecated Usage of the `sx` prop with this component is no longer
18-
* supported. Use the component from `@primer/react` with CSS Modules instead.
19-
*/
20-
PageHeader,
21-
22-
/**
23-
* @deprecated Usage of the `sx` prop with this component is no longer
24-
* supported. Use the component from `@primer/react` with CSS Modules instead.
25-
*/
26-
type PageHeaderProps,
27-
28-
/**
29-
* @deprecated Usage of the `sx` prop with this component is no longer
30-
* supported. Use the component from `@primer/react` with CSS Modules instead.
31-
*/
32-
type PageHeaderActionsProps,
33-
34-
/**
35-
* @deprecated Usage of the `sx` prop with this component is no longer
36-
* supported. Use the component from `@primer/react` with CSS Modules instead.
37-
*/
38-
type PageHeaderTitleProps,
39-
} from './components/PageHeader'
40-
4115
export {
4216
/**
4317
* @deprecated Usage of the `sx` prop with this component is no longer

packages/styled-react/src/index.tsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -311,32 +311,6 @@ export {
311311
Overlay,
312312
} from './components/Overlay'
313313

314-
export {
315-
/**
316-
* @deprecated Usage of the `sx` prop with this component is no longer
317-
* supported. Use the component from `@primer/react` with CSS Modules instead.
318-
*/
319-
PageHeader,
320-
321-
/**
322-
* @deprecated Usage of the `sx` prop with this component is no longer
323-
* supported. Use the component from `@primer/react` with CSS Modules instead.
324-
*/
325-
type PageHeaderProps,
326-
327-
/**
328-
* @deprecated Usage of the `sx` prop with this component is no longer
329-
* supported. Use the component from `@primer/react` with CSS Modules instead.
330-
*/
331-
type PageHeaderActionsProps,
332-
333-
/**
334-
* @deprecated Usage of the `sx` prop with this component is no longer
335-
* supported. Use the component from `@primer/react` with CSS Modules instead.
336-
*/
337-
type PageHeaderTitleProps,
338-
} from './components/PageHeader'
339-
340314
export {
341315
/**
342316
* @deprecated Usage of the `sx` prop with this component is no longer

0 commit comments

Comments
 (0)