Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Button component #4807

Merged
merged 15 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 6 additions & 0 deletions .changeset/strong-tables-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@primer/react": major
"docs": major
---
langermank marked this conversation as resolved.
Show resolved Hide resolved

Remove deprecated `Button` component
74 changes: 0 additions & 74 deletions docs/content/deprecated/Buttons.mdx

This file was deleted.

2 changes: 0 additions & 2 deletions packages/react/codemods/removeSystemProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ const stylePropsMap = {
Breadcrumb: [...COMMON, ...FLEX],
Button: [...COMMON, ...LAYOUT, ...TYPOGRAPHY],
ButtonBase: [...COMMON, ...LAYOUT],
ButtonClose: [...COMMON, ...LAYOUT],
ButtonTableList: [...COMMON, ...TYPOGRAPHY, ...LAYOUT],
CircleBadge: [...COMMON],
CounterLabel: [...COMMON],
Details: [...COMMON],
Expand Down
7 changes: 3 additions & 4 deletions packages/react/src/Details/__tests__/Details.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {render} from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import React from 'react'
import {Details, useDetails, Box} from '../..'
import {Button, ButtonPrimary} from '../../deprecated'
import type {ButtonProps} from '../../deprecated/Button/Button'
import {Details, useDetails, Box, Button} from '../..'
import type {ButtonProps} from '../../Button'
import {behavesAsComponent, checkExports} from '../../utils/testing'
import axe from 'axe-core'

Expand Down Expand Up @@ -90,7 +89,7 @@ describe('Details', () => {
{open ? 'Open' : 'Closed'}
</Button>
<Box>
<ButtonPrimary>test</ButtonPrimary>
<Button variant="primary">test</Button>
</Box>
</Details>
)
Expand Down
7 changes: 4 additions & 3 deletions packages/react/src/Overlay/Overlay.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useRef, useState} from 'react'
import {Overlay, Box, Text} from '..'
import {ButtonDanger, Button} from '../deprecated'
import {Overlay, Box, Text, Button} from '..'
import {render, waitFor, fireEvent} from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import axe from 'axe-core'
Expand Down Expand Up @@ -43,7 +42,9 @@ const TestComponent = ({initialFocus, callback}: TestComponentSettings) => {
>
<Box display="flex" flexDirection="column" p={2}>
<Text>Are you sure?</Text>
<ButtonDanger onClick={closeOverlay}>Cancel</ButtonDanger>
<Button variant="danger" onClick={closeOverlay}>
Cancel
</Button>
<Button onClick={closeOverlay} ref={confirmButtonRef}>
Confirm
</Button>
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/deprecated/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {List} from './ActionList/List'
import type {ItemProps} from './ActionList/Item'
import {Item} from './ActionList/Item'
import {Divider} from './ActionList/Divider'
import type {ButtonProps} from './Button'
import Button from './Button'
import type {ButtonProps} from '../Button'
import {Button} from '../Button'
import React, {useCallback, useMemo} from 'react'
import {AnchoredOverlay} from '../AnchoredOverlay'
import {useProvidedStateOrCreate} from '../hooks/useProvidedStateOrCreate'
Expand Down
41 changes: 0 additions & 41 deletions packages/react/src/deprecated/Button/Button.tsx

This file was deleted.

39 changes: 0 additions & 39 deletions packages/react/src/deprecated/Button/ButtonBase.tsx

This file was deleted.

42 changes: 0 additions & 42 deletions packages/react/src/deprecated/Button/ButtonClose.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions packages/react/src/deprecated/Button/ButtonDanger.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions packages/react/src/deprecated/Button/ButtonInvisible.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions packages/react/src/deprecated/Button/ButtonOutline.tsx

This file was deleted.

Loading
Loading