diff --git a/.changeset/late-feet-attack.md b/.changeset/late-feet-attack.md new file mode 100644 index 0000000000..1a71cb1cbe --- /dev/null +++ b/.changeset/late-feet-attack.md @@ -0,0 +1,5 @@ +--- +"@sumup-oss/circuit-ui": major +--- + +Removed the Table component's deprecated `initialSortedRow` prop. Use the `initialSortedColumn` prop instead. diff --git a/packages/circuit-ui/components/NotificationBanner/NotificationBanner.tsx b/packages/circuit-ui/components/NotificationBanner/NotificationBanner.tsx index b679470ea4..f1ad46149e 100644 --- a/packages/circuit-ui/components/NotificationBanner/NotificationBanner.tsx +++ b/packages/circuit-ui/components/NotificationBanner/NotificationBanner.tsx @@ -167,7 +167,7 @@ export const NotificationBanner = forwardRef< ) { deprecate( 'NotificationBanner', - "The action's `tertiary` variant has been deprecated. Use the `primary` size instead.", + "The action's `tertiary` variant has been deprecated. Use the `secondary` variant instead.", ); } diff --git a/packages/circuit-ui/components/Table/Table.spec.tsx b/packages/circuit-ui/components/Table/Table.spec.tsx index 234e78243d..5603f5d190 100644 --- a/packages/circuit-ui/components/Table/Table.spec.tsx +++ b/packages/circuit-ui/components/Table/Table.spec.tsx @@ -134,30 +134,6 @@ describe('Table', () => { }); }); - it('should sort a column in ascending order when initial sort direction and initial sorted row is provided and console.warn about it', () => { - const warnMock = vi.spyOn(console, 'warn'); - - render( - , - ); - - const cellEls = screen.getAllByRole('cell'); - - const sortedRow = ['a', 'c', 'b']; - - rows.forEach((_row, index) => { - const cellIndex = rowLength * index; - expect(cellEls[cellIndex]).toHaveTextContent(sortedRow[index]); - }); - expect(warnMock).toHaveBeenCalled(); - }); - it('should sort a column in descending order', async () => { render(
); diff --git a/packages/circuit-ui/components/Table/Table.tsx b/packages/circuit-ui/components/Table/Table.tsx index c59c60aba9..1af4acc6a5 100644 --- a/packages/circuit-ui/components/Table/Table.tsx +++ b/packages/circuit-ui/components/Table/Table.tsx @@ -20,7 +20,6 @@ import { Component, createRef, type HTMLAttributes, type UIEvent } from 'react'; import { isNil } from '../../util/type-check.js'; import { throttle } from '../../util/helpers.js'; import { clsx } from '../../styles/clsx.js'; -import { deprecate } from '../../util/logger.js'; import { TableHead } from './components/TableHead/index.js'; import { TableBody } from './components/TableBody/index.js'; @@ -68,12 +67,6 @@ export interface TableProps extends HTMLAttributes { * Specifies the initial sort order of the table */ initialSortDirection?: 'ascending' | 'descending'; - /** - * @deprecated - * - * Use the `initialSortedColumn` prop instead. - */ - initialSortedRow?: number; /** * Specifies the column index which `initialSortDirection` will be applied to */ @@ -104,19 +97,12 @@ type TableState = { export class Table extends Component { constructor(props: TableProps) { super(props); - if (process.env.NODE_ENV !== 'production' && this.props.initialSortedRow) { - deprecate( - 'Table', - 'The `initialSortedRow` prop has been deprecated. Use the `initialSortedColumn` prop instead.', - ); - } this.state = { - sortedColumn: - this.props.initialSortedColumn || this.props.initialSortedRow, + sortedColumn: this.props.initialSortedColumn, rows: this.getInitialRows( this.props.rows, this.props.initialSortDirection, - this.props.initialSortedColumn || this.props.initialSortedRow, + this.props.initialSortedColumn, ), sortHover: undefined, sortDirection: this.props.initialSortDirection,