Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/warm-spoons-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/styled-react": patch
---

Remove PageHeader from @primer/styled-react
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ exports[`@primer/styled-react exports 1`] = `
"LinkButton",
"merge",
"Overlay",
"PageHeader",
"SegmentedControl",
"Spinner",
"sx",
Expand Down Expand Up @@ -54,7 +53,6 @@ exports[`@primer/styled-react/deprecated exports 1`] = `
exports[`@primer/styled-react/experimental exports 1`] = `
[
"Dialog",
"PageHeader",
"Table",
"Tooltip",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import {render, screen} from '@testing-library/react'
import {describe, expect, test} from 'vitest'
import {Dialog, PageHeader, Table, Tooltip} from '../experimental'
import {Dialog, Table, Tooltip} from '../experimental'

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

test('PageHeader supports `sx` prop', () => {
const {container} = render(<PageHeader as="div" data-testid="component" sx={{background: 'red'}} role="article" />)
expect(container.firstElementChild!).toHaveAttribute('role', 'article')
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
})

test('Table.Container', () => {
render(<Table.Container data-testid="component" sx={{background: 'red'}} />)
expect(window.getComputedStyle(screen.getByTestId('component')).backgroundColor).toBe('rgb(255, 0, 0)')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
Link,
LinkButton,
Overlay,
PageHeader,
SegmentedControl,
Spinner,
Text,
Expand Down Expand Up @@ -197,22 +196,6 @@ describe('@primer/react', () => {
expect(screen.getByTestId('component')).toHaveAttribute('role', 'dialog')
})

test('PageHeader supports `sx` prop', () => {
const {container} = render(<PageHeader as="div" data-testid="component" sx={{background: 'red'}} role="article" />)
expect(container.firstElementChild!).toHaveAttribute('role', 'article')
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
})

test('PageHeader.Actions supports `sx` prop', () => {
const {container} = render(<PageHeader.Actions data-testid="component" sx={{background: 'red'}} />)
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
})

test('PageHeader.Title supports `sx` prop', () => {
const {container} = render(<PageHeader.Title data-testid="component" sx={{background: 'red'}} />)
expect(window.getComputedStyle(container.firstElementChild!).backgroundColor).toBe('rgb(255, 0, 0)')
})

test('SegmentedControl supports `sx` prop', () => {
render(<SegmentedControl data-testid="component" sx={{background: 'red'}} />)
expect(window.getComputedStyle(screen.getByTestId('component')).backgroundColor).toBe('rgb(255, 0, 0)')
Expand Down
116 changes: 0 additions & 116 deletions packages/styled-react/src/components/PageHeader.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions packages/styled-react/src/experimental.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,6 @@ export {
type DialogProps,
} from './components/Dialog'

export {
/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
PageHeader,

/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
type PageHeaderProps,

/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
type PageHeaderActionsProps,

/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
type PageHeaderTitleProps,
} from './components/PageHeader'

export {
/**
* @deprecated Usage of the `sx` prop with this component is no longer
Expand Down
26 changes: 0 additions & 26 deletions packages/styled-react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,32 +311,6 @@ export {
Overlay,
} from './components/Overlay'

export {
/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
PageHeader,

/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
type PageHeaderProps,

/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
type PageHeaderActionsProps,

/**
* @deprecated Usage of the `sx` prop with this component is no longer
* supported. Use the component from `@primer/react` with CSS Modules instead.
*/
type PageHeaderTitleProps,
} from './components/PageHeader'

export {
/**
* @deprecated Usage of the `sx` prop with this component is no longer
Expand Down
Loading