Skip to content

Commit

Permalink
feat: Deprecated Table in Main (#2344)
Browse files Browse the repository at this point in the history
Deprecate `Table` in main.

Resolves: #2249

[category:Components]

Co-authored-by: @mannycarrera4 <[email protected]>
  • Loading branch information
thunguyen19 and mannycarrera4 authored Sep 25, 2023
1 parent c98487a commit a7a2138
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ any questions.
- [useBanner](#useBanner)
- [Deprecations](#deprecations)
- [InputIconContainer](#input-icon-container)
- [Table](#table)
- [Token Updates](#token-updates)
- [Space and Depth](#space-and-depth)
- [Component Updates](#component-updates)
Expand Down Expand Up @@ -70,6 +71,10 @@ and browsers can compute the name of the Banner from the text given inside.
We've deprecated `InputIconContainer` from [Main](#main) because it doesn't handle
bidirectionality or icons at the start of an input. Please consider using [`InputGroup`](https://workday.github.io/canvas-kit/?path=/story/components-inputs-text-input--icons) instead.

### Table

We've deprecated `Table` and `TableRow` as well as all of their exported members. Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.

## Token Updates

### Space and Depth
Expand Down
4 changes: 4 additions & 0 deletions modules/react/table/lib/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const TableComponent = styled('table')(type.levels.subtext.large, {
},
});

/**
* @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
* Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
*/
export class Table extends React.Component<React.TableHTMLAttributes<HTMLTableElement>> {
public render() {
const {children, ...elemProps} = this.props;
Expand Down
12 changes: 12 additions & 0 deletions modules/react/table/lib/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import {colors, space, spaceNumbers, statusColors} from '@workday/canvas-kit-rea
import {createComponent, StyledType} from '@workday/canvas-kit-react/common';
import {borderColor, borderWidth, cellBorder} from './Table';

/**
* @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
* Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
*/
export enum TableRowState {
Error,
Alert,
Expand All @@ -14,6 +18,10 @@ export enum TableRowState {
Selected,
}

/**
* @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
* Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
*/
export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
/**
* The state of the TableRow. Accepts `Error`, `Alert`, `InputError`, `InputAlert`, `Hover`, or `Selected`.
Expand Down Expand Up @@ -192,6 +200,10 @@ const StyledTableRow = styled('tr')<TableRowProps>(
}
);

/**
* @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
* Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
*/
export const TableRow = createComponent('tr')({
displayName: 'TableRow',
Component: (
Expand Down

0 comments on commit a7a2138

Please sign in to comment.