From 5fb804a6e7ffc3b139e2bd6f9541922473b2279c Mon Sep 17 00:00:00 2001 From: Amal K Joy <153802538+amal-k-joy@users.noreply.github.com> Date: Thu, 21 Nov 2024 00:42:14 +0530 Subject: [PATCH] chore(FilterPanel): deprecate filter panel and its sub components (#6431) * chore(FilterPanel): deprecare filter panel and its sub components * chore: change headind to Deprecation notice --------- Co-authored-by: David Menendez Co-authored-by: elysia --- .../FilterPanel/FilterPanel-test.avt.e2e.js | 2 +- .../src/components/FilterPanel/FilterPanel.js | 6 ++++++ .../src/components/FilterPanel/FilterPanel.mdx | 5 +++++ .../FilterPanel/FilterPanel.stories.jsx | 18 +++++++++++++++++- .../components/FilterPanel/FilterPanel.test.js | 3 +++ .../FilterPanelAccordion.js | 6 ++++++ .../FilterPanelAccordion.mdx | 5 +++++ .../FilterPanelAccordion.stories.jsx | 18 +++++++++++++++++- .../FilterPanelAccordion.test.js | 3 +++ .../FilterPanelAccordionItem.js | 5 +++++ .../FilterPanelAccordionItem.mdx | 5 +++++ .../FilterPanelAccordionItem.stories.jsx | 18 +++++++++++++++++- .../FilterPanelAccordionItem.test.js | 3 +++ .../FilterPanelCheckbox/FilterPanelCheckbox.js | 6 ++++++ .../FilterPanelCheckbox.mdx | 5 +++++ .../FilterPanelCheckbox.stories.jsx | 18 +++++++++++++++++- .../FilterPanelCheckbox.test.js | 3 +++ .../FilterPanelCheckboxWithOverflow.js | 6 ++++++ .../FilterPanelCheckboxWithOverflow.mdx | 5 +++++ ...FilterPanelCheckboxWithOverflow.stories.jsx | 18 +++++++++++++++++- .../FilterPanelCheckboxWithOverflow.test.js | 3 +++ .../FilterPanelGroup/FilterPanelGroup.js | 6 ++++++ .../FilterPanelGroup/FilterPanelGroup.mdx | 5 +++++ .../FilterPanelGroup.stories.jsx | 18 +++++++++++++++++- .../FilterPanelGroup/FilterPanelGroup.test.js | 3 +++ .../FilterPanelSearch/FilterPanelSearch.js | 5 +++++ .../FilterPanelSearch/FilterPanelSearch.mdx | 5 +++++ .../FilterPanelSearch.stories.jsx | 18 +++++++++++++++++- .../FilterPanelSearch.test.js | 3 +++ 29 files changed, 216 insertions(+), 8 deletions(-) diff --git a/e2e/components/FilterPanel/FilterPanel-test.avt.e2e.js b/e2e/components/FilterPanel/FilterPanel-test.avt.e2e.js index fe231fddb3..5b52aa2576 100644 --- a/e2e/components/FilterPanel/FilterPanel-test.avt.e2e.js +++ b/e2e/components/FilterPanel/FilterPanel-test.avt.e2e.js @@ -15,7 +15,7 @@ test.describe('FilterPanel @avt', () => { test('@avt-default-state', async ({ page }) => { await visitStory(page, { component: 'FilterPanel', - id: 'experimental-components-filter-panel-filterpanel--default', + id: 'deprecated-filter-panel-filterpanel--default', globals: { carbonTheme: 'white', }, diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanel.js b/packages/ibm-products/src/components/FilterPanel/FilterPanel.js index c756b66f44..37809ad538 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanel.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanel.js @@ -19,7 +19,9 @@ const componentName = 'FilterPanel'; /** * The container for filter panel subcomponents. + * @deprecated This component is deprecated */ + export let FilterPanel = React.forwardRef( ({ children, className, title, ...rest }, ref) => { return ( @@ -35,6 +37,10 @@ export let FilterPanel = React.forwardRef( ); } ); +FilterPanel.deprecated = { + level: 'warn', + details: `This component is deprecated`, +}; // Return a placeholder if not released and not enabled by feature flag FilterPanel = pkg.checkComponentEnabled(FilterPanel, componentName); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanel.mdx b/packages/ibm-products/src/components/FilterPanel/FilterPanel.mdx index f5e9db0329..b2544a6bb3 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanel.mdx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanel.mdx @@ -11,6 +11,11 @@ import * as FilterPanelStories from './FilterPanel.stories'; - [Example usage](#example-usage) - [Component API](#component-api) +## Deprecation notice + +> This component is deprecated and will be removed in the next major version. + + ## Overview The `FilterPanel` is the container for its subcomponents. diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanel.stories.jsx b/packages/ibm-products/src/components/FilterPanel/FilterPanel.stories.jsx index d9a910a4b3..6dd49f4a95 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanel.stories.jsx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanel.stories.jsx @@ -24,11 +24,12 @@ import { import mdx from './FilterPanel.mdx'; import styles from './_storybook-styles.scss?inline'; +import { Annotation } from '../../../../core/.storybook/Annotation'; const storyClass = 'filter-panel-stories'; export default { - title: 'Experimental/Components/Filter panel/FilterPanel', + title: 'Deprecated/Filter panel/FilterPanel', component: FilterPanel, tags: ['autodocs'], parameters: { @@ -64,6 +65,21 @@ export default { args: { title: 1, }, + decorators: [ + (story) => ( + + This component is deprecated and will be removed in the next major + version. + + } + > + {story()} + + ), + ], }; const demoData = [ diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanel.test.js b/packages/ibm-products/src/components/FilterPanel/FilterPanel.test.js index 06447e4239..915c95b8b9 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanel.test.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanel.test.js @@ -25,6 +25,9 @@ const renderComponent = ({ ...rest } = {}) => render(); describe(componentName, () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); it('renders a component FilterPanel', async () => { renderComponent(); expect(screen.getByTestId(dataTestId)).toBeInTheDocument(); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js index 265268114f..f2f5797e0d 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js @@ -25,6 +25,7 @@ const defaults = { /** * A container with a label and optional count. + * @deprecated This component is deprecated */ export let FilterPanelAccordion = React.forwardRef( ( @@ -62,6 +63,11 @@ export let FilterPanelAccordion = React.forwardRef( } ); +FilterPanelAccordion.deprecated = { + level: 'warn', + details: `This component is deprecated`, +}; + // Return a placeholder if not released and not enabled by feature flag FilterPanelAccordion = pkg.checkComponentEnabled( FilterPanelAccordion, diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.mdx b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.mdx index 8b9d7e8794..bd91daef62 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.mdx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.mdx @@ -11,6 +11,11 @@ import * as FilterPanelAccordionStories from './FilterPanelAccordion.stories'; - [Example usage](#example-usage) - [Component API](#component-api) +## Deprecation notice + +> This component is deprecated and will be removed in the next major version. + + ## Overview The `FilterPanelAccordion` is a container required for grouping diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.stories.jsx b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.stories.jsx index ba13deeaec..f91aaab1b4 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.stories.jsx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.stories.jsx @@ -14,11 +14,12 @@ import mdx from './FilterPanelAccordion.mdx'; import uuidv4 from '../../../global/js/utils/uuidv4'; import styles from '../_storybook-styles.scss?inline'; +import { Annotation } from '../../../../../core/.storybook/Annotation'; const storyClass = 'filter-panel-stories'; export default { - title: 'Experimental/Components/Filter panel/FilterPanelAccordion', + title: 'Deprecated/Filter panel/FilterPanelAccordion', component: FilterPanelAccordion, tags: ['autodocs'], parameters: { @@ -74,6 +75,21 @@ export default { count: 1, labelText: 0, }, + decorators: [ + (story) => ( + + This component is deprecated and will be removed in the next major + version. + + } + > + {story()} + + ), + ], }; const Template = (args) => { diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.test.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.test.js index 6618974bca..9bfa2a2161 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.test.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.test.js @@ -33,6 +33,9 @@ const renderComponent = ({ ...rest } = {}) => ); describe(componentName, () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); const { getComputedStyle } = window; beforeEach(() => { diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js index 69e584f526..7b5a4e06c6 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js @@ -27,6 +27,7 @@ const defaults = { /** * A container with a label and optional count. + * @deprecated This component is deprecated */ export let FilterPanelAccordionItem = React.forwardRef( ( @@ -72,6 +73,10 @@ export let FilterPanelAccordionItem = React.forwardRef( } ); +FilterPanelAccordionItem.deprecated = { + level: 'warn', + details: `This component is deprecated`, +}; // Return a placeholder if not released and not enabled by feature flag FilterPanelAccordionItem = pkg.checkComponentEnabled( FilterPanelAccordionItem, diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.mdx b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.mdx index 4f436f0b17..795ec49dd1 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.mdx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.mdx @@ -12,6 +12,11 @@ import * as FilterPanelAccordionItemStories from './FilterPanelAccordionItem.sto - [Truncated usage](#truncated-usage) - [Component API](#component-api) +## Deprecation notice + +> This component is deprecated and will be removed in the next major version. + + ## Overview The `FilterPanelAccordionItem` can be expanded and collapsed and will accept any diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.stories.jsx b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.stories.jsx index 11aee1b57e..87e1205652 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.stories.jsx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.stories.jsx @@ -18,11 +18,12 @@ import mdx from './FilterPanelAccordionItem.mdx'; import uuidv4 from '../../../global/js/utils/uuidv4'; import styles from '../_storybook-styles.scss?inline'; +import { Annotation } from '../../../../../core/.storybook/Annotation'; const storyClass = 'filter-panel-stories'; export default { - title: 'Experimental/Components/Filter panel/FilterPanelAccordionItem', + title: 'Deprecated/Filter panel/FilterPanelAccordionItem', component: FilterPanelAccordionItem, tags: ['autodocs'], parameters: { @@ -77,6 +78,21 @@ export default { count: 1, labelText: 0, }, + decorators: [ + (story) => ( + + This component is deprecated and will be removed in the next major + version. + + } + > + {story()} + + ), + ], }; const Template = (args) => { diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.test.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.test.js index 74eb982319..dccc57b1d1 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.test.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.test.js @@ -31,6 +31,9 @@ const renderComponent = ({ ...rest } = {}) => ); describe(componentName, () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); it('renders a component FilterPanelAccordionItem', async () => { const { container } = renderComponent(); const component = container.querySelector(`.${blockClass}`); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js index 33fdbaa0da..f1ee938e7c 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js @@ -26,6 +26,7 @@ const componentName = 'FilterPanelCheckbox'; * * All of Carbon Checkbox's props are directly available * through "...rest", including id, onClick, etc. + * @deprecated This component is deprecated */ export let FilterPanelCheckbox = React.forwardRef( ({ className, count, id, labelText, title, ...rest }, ref) => { @@ -44,6 +45,11 @@ export let FilterPanelCheckbox = React.forwardRef( } ); +FilterPanelCheckbox.deprecated = { + level: 'warn', + details: `This component is deprecated`, +}; + // Return a placeholder if not released and not enabled by feature flag FilterPanelCheckbox = pkg.checkComponentEnabled( FilterPanelCheckbox, diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.mdx b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.mdx index 10b41d3c7f..5b981f8da8 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.mdx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.mdx @@ -11,6 +11,11 @@ import * as FilterPanelCheckboxStories from './FilterPanelCheckbox.stories'; - [Example usage](#example-usage) - [Component API](#component-api) +## Deprecation notice + +> This component is deprecated and will be removed in the next major version. + + ## Overview The `FilterPanelCheckbox` is a modified Carbon `Checkbox` and accepts both a diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.stories.jsx b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.stories.jsx index e6dc8d6a09..3217f5e8ea 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.stories.jsx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.stories.jsx @@ -14,11 +14,12 @@ import { FilterPanel, FilterPanelCheckbox } from '..'; import mdx from './FilterPanelCheckbox.mdx'; import styles from '../_storybook-styles.scss?inline'; +import { Annotation } from '../../../../../core/.storybook/Annotation'; const storyClass = 'filter-panel-stories'; export default { - title: 'Experimental/Components/Filter panel/FilterPanelCheckbox', + title: 'Deprecated/Filter panel/FilterPanelCheckbox', component: FilterPanelCheckbox, tags: ['autodocs'], argTypes: { @@ -72,6 +73,21 @@ export default { page: mdx, }, }, + decorators: [ + (story) => ( + + This component is deprecated and will be removed in the next major + version. + + } + > + {story()} + + ), + ], }; const Template = (args) => { diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.test.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.test.js index e979019aa3..5a9fb72a98 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.test.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.test.js @@ -29,6 +29,9 @@ const renderComponent = ({ ...rest } = {}) => ); describe(componentName, () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); it('renders a component FilterPanelCheckbox', async () => { const { container } = renderComponent(); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js index 1ea815925e..637400c1a5 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js @@ -30,6 +30,7 @@ const defaults = { * just like FilterPanelCheckbox. * * Use `overflowMenuProps` for properties specific to the OverflowMenu. + * @deprecated This component is deprecated */ export let FilterPanelCheckboxWithOverflow = React.forwardRef( ( @@ -122,6 +123,11 @@ export let FilterPanelCheckboxWithOverflow = React.forwardRef( } ); +FilterPanelCheckboxWithOverflow.deprecated = { + level: 'warn', + details: `This component is deprecated`, +}; + // Return a placeholder if not released and not enabled by feature flag FilterPanelCheckboxWithOverflow = pkg.checkComponentEnabled( FilterPanelCheckboxWithOverflow, diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.mdx b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.mdx index 56122df46c..e16e5f539e 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.mdx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.mdx @@ -11,6 +11,11 @@ import * as FilterPanelCheckboxWithOverflowStories from './FilterPanelCheckboxWi - [Example usage](#example-usage) - [Component API](#component-api) +## Deprecation notice + +> This component is deprecated and will be removed in the next major version. + + ## Overview The `FilterPanelCheckboxWithOverflow` is like `FilterPanelCheckbox`, but diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.stories.jsx b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.stories.jsx index 0522bf973f..cbd04e1eca 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.stories.jsx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.stories.jsx @@ -16,11 +16,12 @@ import { FilterPanelCheckboxWithOverflow } from '.'; import mdx from './FilterPanelCheckboxWithOverflow.mdx'; import styles from '../_storybook-styles.scss?inline'; +import { Annotation } from '../../../../../core/.storybook/Annotation'; const storyClass = 'filter-panel-stories'; export default { - title: 'Experimental/Components/Filter panel/FilterPanelCheckboxWithOverflow', + title: 'Deprecated/Filter panel/FilterPanelCheckboxWithOverflow', component: FilterPanelCheckboxWithOverflow, tags: ['autodocs'], argTypes: { @@ -75,6 +76,21 @@ export default { page: mdx, }, }, + decorators: [ + (story) => ( + + This component is deprecated and will be removed in the next major + version. + + } + > + {story()} + + ), + ], }; const Template = (args) => { diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.test.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.test.js index e83562caf2..378756b6d4 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.test.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.test.js @@ -38,6 +38,9 @@ const renderComponent = ({ ...rest } = {}) => ); describe(componentName, () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); it('renders a component FilterPanelCheckboxWithOverflow', async () => { renderComponent(); expect(screen.getByRole('checkbox')).toBeInTheDocument(); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js index bcb7a42201..3e5bc9f485 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js @@ -20,6 +20,7 @@ const componentName = 'FilterPanelGroup'; /** * A container with a label and optional count. + * @deprecated This component is deprecated */ export let FilterPanelGroup = React.forwardRef( ({ children, className, count, labelText, title, ...rest }, ref) => { @@ -45,6 +46,11 @@ export let FilterPanelGroup = React.forwardRef( } ); +FilterPanelGroup.deprecated = { + level: 'warn', + details: `This component is deprecated`, +}; + // Return a placeholder if not released and not enabled by feature flag FilterPanelGroup = pkg.checkComponentEnabled(FilterPanelGroup, componentName); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.mdx b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.mdx index 6e567716ea..19c2a0492a 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.mdx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.mdx @@ -11,6 +11,11 @@ import * as FilterPanelGroupStories from './FilterPanelGroup.stories'; - [Example usage](#example-usage) - [Component API](#component-api) +## Deprecation notice + +> This component is deprecated and will be removed in the next major version. + + ## Overview The `FilterPanelGroup` is a container for visually grouping content with a label diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.stories.jsx b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.stories.jsx index 2584d54579..f40ec9957e 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.stories.jsx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.stories.jsx @@ -11,11 +11,12 @@ import { FilterPanel, FilterPanelGroup } from '..'; import mdx from './FilterPanelGroup.mdx'; import styles from '../_storybook-styles.scss?inline'; +import { Annotation } from '../../../../../core/.storybook/Annotation'; const storyClass = 'filter-panel-stories'; export default { - title: 'Experimental/Components/Filter panel/FilterPanelGroup', + title: 'Deprecated/Filter panel/FilterPanelGroup', component: FilterPanelGroup, tags: ['autodocs'], parameters: { @@ -69,6 +70,21 @@ export default { count: 1, labelText: 0, }, + decorators: [ + (story) => ( + + This component is deprecated and will be removed in the next major + version. + + } + > + {story()} + + ), + ], }; const Template = (args) => { diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.test.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.test.js index a3013153dd..33a72e333f 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.test.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.test.js @@ -35,6 +35,9 @@ const renderComponent = ({ ...rest } = {}) => ); describe(componentName, () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); it('renders a component FilterPanelGroup', async () => { renderComponent(); expect(screen.getByTestId(dataTestId)).toBeInTheDocument(); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js index e435c00867..91fde36584 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js @@ -24,6 +24,7 @@ const defaults = { /** * An input field and container to show search results. + * @deprecated This component is deprecated */ export let FilterPanelSearch = React.forwardRef( ( @@ -71,6 +72,10 @@ export let FilterPanelSearch = React.forwardRef( } ); +FilterPanelSearch.deprecated = { + level: 'warn', + details: `This component is deprecated`, +}; // Return a placeholder if not released and not enabled by feature flag FilterPanelSearch = pkg.checkComponentEnabled(FilterPanelSearch, componentName); diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.mdx b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.mdx index 699ef45299..4a2473bad1 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.mdx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.mdx @@ -11,6 +11,11 @@ import * as FilterPanelSearchStories from './FilterPanelSearch.stories'; - [Example usage](#example-usage) - [Component API](#component-api) +## Deprecation notice + +> This component is deprecated and will be removed in the next major version. + + ## Overview The `FilterPanelSearch` returns the value when the search value changes. diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.stories.jsx b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.stories.jsx index 080b16ad77..cf00c5e347 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.stories.jsx +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.stories.jsx @@ -12,11 +12,12 @@ import { FilterPanelSearch } from '.'; import mdx from './FilterPanelSearch.mdx'; import styles from '../_storybook-styles.scss?inline'; +import { Annotation } from '../../../../../core/.storybook/Annotation'; const storyClass = 'filter-panel-stories'; export default { - title: 'Experimental/Components/Filter Panel/FilterPanelSearch', + title: 'Deprecated/Filter Panel/FilterPanelSearch', component: FilterPanelSearch, tags: ['autodocs'], parameters: { @@ -29,6 +30,21 @@ export default { children: { table: { disable: true } }, className: { control: { type: {} } }, }, + decorators: [ + (story) => ( + + This component is deprecated and will be removed in the next major + version. + + } + > + {story()} + + ), + ], }; const Template = (args) => { diff --git a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.test.js b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.test.js index 84572905f8..6d8434d584 100644 --- a/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.test.js +++ b/packages/ibm-products/src/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.test.js @@ -33,6 +33,9 @@ const renderComponent = ({ ...rest } = {}) => ); describe(componentName, () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); it('renders a component FilterPanelSearch', async () => { renderComponent(); expect(screen.getByTestId(dataTestId)).toHaveClass(blockClass);