Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: Assess stabilization of ToggleGroupControl #61067

Draft
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- `ToggleGroupControl`: Remove "experimental" designation ([#61067](https://github.com/WordPress/gutenberg/pull/61067)).

### Enhancements

- `InputControl`: Add a password visibility toggle story ([#60898](https://github.com/WordPress/gutenberg/pull/60898)).
Expand Down
12 changes: 12 additions & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,21 @@ export { default as TextHighlight } from './text-highlight';
export { default as Tip } from './tip';
export { default as ToggleControl } from './toggle-control';
export {
/**
* @deprecated Import `ToggleGroupControl` instead.
*/
ToggleGroupControl as __experimentalToggleGroupControl,
/**
* @deprecated Import `ToggleGroupControlOption` instead.
*/
ToggleGroupControlOption as __experimentalToggleGroupControlOption,
/**
* @deprecated Import `ToggleGroupControlOptionIcon` instead.
*/
ToggleGroupControlOptionIcon as __experimentalToggleGroupControlOptionIcon,
ToggleGroupControl,
ToggleGroupControlOption,
ToggleGroupControlOptionIcon,
} from './toggle-group-control';
export {
Toolbar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const meta: Meta< typeof ToggleGroupControl > = {
component: ToggleGroupControl,
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
subcomponents: { ToggleGroupControlOption, ToggleGroupControlOptionIcon },
title: 'Components (Experimental)/ToggleGroupControl',
title: 'Components/ToggleGroupControl',
argTypes: {
help: { control: { type: 'text' } },
onChange: { action: 'onChange' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ function ToggleGroupControlOptionBase(
* @example
* ```jsx
* import {
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOptionBase as ToggleGroupControlOptionBase,
* ToggleGroupControl,
* ToggleGroupControlOptionBase,
* } from '@wordpress/components';
*
* function Example() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# `ToggleGroupControlOptionIcon`

<div class="callout callout-alert">
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
</div>

`ToggleGroupControlOptionIcon` is a form component which is meant to be used as a child of [`ToggleGroupControl`](/packages/components/src/toggle-group-control/toggle-group-control/README.md) and displays an icon.

## Usage

```js
import {
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
ToggleGroupControl,
ToggleGroupControlOptionIcon,
} from '@wordpress/components';
import { formatLowercase, formatUppercase } from '@wordpress/icons';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function UnforwardedToggleGroupControlOptionIcon(
* ```jsx
*
* import {
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
* ToggleGroupControl,
* ToggleGroupControlOptionIcon,
* from '@wordpress/components';
* import { formatLowercase, formatUppercase } from '@wordpress/icons';
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# `ToggleGroupControlOption`

<div class="callout callout-alert">
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
</div>

`ToggleGroupControlOption` is a form component and is meant to be used as a child of [`ToggleGroupControl`](/packages/components/src/toggle-group-control/toggle-group-control/README.md).


## Usage

```js
import {
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
ToggleGroupControl,
ToggleGroupControlOption,
} from '@wordpress/components';

function Example() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function UnforwardedToggleGroupControlOption(
*
* ```jsx
* import {
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOption as ToggleGroupControlOption,
* ToggleGroupControl,
* ToggleGroupControlOption,
* } from '@wordpress/components';
*
* function Example() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# `ToggleGroupControl`

<div class="callout callout-alert">
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
</div>

`ToggleGroupControl` is a form component that lets users choose options represented in horizontal segments. To render options for this control use [`ToggleGroupControlOption`](/packages/components/src/toggle-group-control/toggle-group-control-option/README.md) component.

This component is intended for selecting a single persistent value from a set of options, similar to a how a radio button group would work. If you simply want a toggle to switch between views, use a [`TabPanel`](/packages/components/src/tab-panel/README.md) instead.
Expand All @@ -14,8 +10,8 @@ Only use this control when you know for sure the labels of items inside won't wr

```js
import {
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
ToggleGroupControl,
ToggleGroupControlOption,
} from '@wordpress/components';

function Example() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ function UnconnectedToggleGroupControl(
*
* ```jsx
* import {
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOption as ToggleGroupControlOption,
* ToggleGroupControl,
* ToggleGroupControlOption,
* } from '@wordpress/components';
*
* function Example() {
Expand Down
5 changes: 4 additions & 1 deletion storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<script>
( function redirectIfStoryMoved() {
const PREVIOUSLY_EXPERIMENTAL_COMPONENTS = [ 'navigation' ];
const PREVIOUSLY_EXPERIMENTAL_COMPONENTS = [
'navigation',
'togglegroupcontrol',
];
const REDIRECTS = [
{
from: /\/components-deprecated-/,
Expand Down
Loading