From ce7c78b3f6218be58c34c0c07f64f08286d59c8f Mon Sep 17 00:00:00 2001 From: Thu Nguyen Date: Wed, 20 Sep 2023 10:27:00 -0700 Subject: [PATCH 1/2] feat: Deprecated Table in Main --- modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx | 5 +++++ modules/react/table/lib/Table.tsx | 5 +++++ modules/react/table/lib/TableRow.tsx | 15 +++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx b/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx index 7f940705ce..cac26bf2e9 100644 --- a/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx +++ b/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx @@ -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) @@ -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`, `TableRow` components and all of their exported members. Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead as it is more flexible and modern. + ## Token Updates ### Space and Depth diff --git a/modules/react/table/lib/Table.tsx b/modules/react/table/lib/Table.tsx index 863b2651e9..43f1c09e71 100644 --- a/modules/react/table/lib/Table.tsx +++ b/modules/react/table/lib/Table.tsx @@ -16,6 +16,11 @@ const TableComponent = styled('table')(type.levels.subtext.large, { }, }); +/** + * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ + * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. + * @deprecated + */ export class Table extends React.Component> { public render() { const {children, ...elemProps} = this.props; diff --git a/modules/react/table/lib/TableRow.tsx b/modules/react/table/lib/TableRow.tsx index dfa8c85325..b0747b808d 100644 --- a/modules/react/table/lib/TableRow.tsx +++ b/modules/react/table/lib/TableRow.tsx @@ -5,6 +5,11 @@ 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'; +/** + * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ + * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. + * @deprecated + */ export enum TableRowState { Error, Alert, @@ -14,6 +19,11 @@ export enum TableRowState { Selected, } +/** + * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ + * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. + * @deprecated + */ export interface TableRowProps extends React.HTMLAttributes { /** * The state of the TableRow. Accepts `Error`, `Alert`, `InputError`, `InputAlert`, `Hover`, or `Selected`. @@ -192,6 +202,11 @@ const StyledTableRow = styled('tr')( } ); +/** + * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ + * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. + * @deprecated + */ export const TableRow = createComponent('tr')({ displayName: 'TableRow', Component: ( From b2ef9a2b79af52ba2860768e99a23a59ca160169 Mon Sep 17 00:00:00 2001 From: Manuel Carrera Date: Mon, 25 Sep 2023 11:01:45 -0600 Subject: [PATCH 2/2] Apply suggestions from code review --- modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx | 2 +- modules/react/table/lib/Table.tsx | 5 ++--- modules/react/table/lib/TableRow.tsx | 15 ++++++--------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx b/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx index cac26bf2e9..8dab599244 100644 --- a/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx +++ b/modules/docs/mdx/10.0-UPGRADE_GUIDE.mdx @@ -73,7 +73,7 @@ bidirectionality or icons at the start of an input. Please consider using [`Inpu ### Table -We've deprecated `Table`, `TableRow` components and all of their exported members. Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead as it is more flexible and modern. +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 diff --git a/modules/react/table/lib/Table.tsx b/modules/react/table/lib/Table.tsx index 43f1c09e71..a9bfcfc464 100644 --- a/modules/react/table/lib/Table.tsx +++ b/modules/react/table/lib/Table.tsx @@ -17,9 +17,8 @@ const TableComponent = styled('table')(type.levels.subtext.large, { }); /** - * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ - * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. - * @deprecated + * @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> { public render() { diff --git a/modules/react/table/lib/TableRow.tsx b/modules/react/table/lib/TableRow.tsx index b0747b808d..245f154b54 100644 --- a/modules/react/table/lib/TableRow.tsx +++ b/modules/react/table/lib/TableRow.tsx @@ -6,9 +6,8 @@ import {createComponent, StyledType} from '@workday/canvas-kit-react/common'; import {borderColor, borderWidth, cellBorder} from './Table'; /** - * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ - * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. - * @deprecated + * @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, @@ -20,9 +19,8 @@ export enum TableRowState { } /** - * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ - * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. - * @deprecated + * @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 { /** @@ -203,9 +201,8 @@ const StyledTableRow = styled('tr')( ); /** - * ### ⚠️ `Table` has been deprecated and will be removed in a future major version. ⚠️ - * - Please consider using [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview. - * @deprecated + * @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',