Skip to content

Commit

Permalink
Address the feedbacks for deprecation for ButtonGroupControl
Browse files Browse the repository at this point in the history
  • Loading branch information
hbhalodia committed Dec 16, 2024
1 parent 27a96a5 commit d533aca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion packages/components/src/button-group/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# ButtonGroup

This component is deprecated, instead use `ToggleGroupControl` component.
<div class="callout callout-alert">
This component is deprecated. Use `ToggleGroupControl` instead.
</div>

ButtonGroup can be used to group any related buttons together. To emphasize related buttons, a group should share a common container.

![ButtonGroup component](https://wordpress.org/gutenberg/files/2018/12/s_96EC471FE9C9D91A996770229947AAB54A03351BDE98F444FD3C1BF0CED365EA_1541792995815_ButtonGroup.png)
Expand Down
7 changes: 2 additions & 5 deletions packages/components/src/button-group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ function UnforwardedButtonGroup(
const { className, ...restProps } = props;
const classes = clsx( 'components-button-group', className );

/**
* Add deprecation notice for `ButtonGroup` component.
*/
deprecated( 'wp.components.ButtonGroup', {
since: '6.7',
since: '6.8',
alternative: 'wp.components.ToggleGroupControl',
} );

Expand All @@ -40,7 +37,7 @@ function UnforwardedButtonGroup(
* ButtonGroup can be used to group any related buttons together. To emphasize
* related buttons, a group should share a common container.
*
* @deprecated use `ToggleGroupControl` instead.
* @deprecated Use `ToggleGroupControl` instead.
*
* ```jsx
* import { Button, ButtonGroup } from '@wordpress/components';
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/button-group/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import type { Meta, StoryObj } from '@storybook/react';
import ButtonGroup from '..';
import Button from '../../button';

/**
* ButtonGroup can be used to group any related buttons together.
* To emphasize related buttons, a group should share a common container.
*
* This component is deprecated. Use `ToggleGroupControl` instead.
*/
const meta: Meta< typeof ButtonGroup > = {
title: 'Components (Deprecated)/ButtonGroup',
id: 'components-buttongroup',
Expand Down

0 comments on commit d533aca

Please sign in to comment.