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
Changes from 1 commit
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
Next Next commit
Remove "experimental" designation for ToggleGroupControl
fullofcaffeine committed Apr 25, 2024

Verified

This commit was signed with the committer’s verified signature.
scala-steward Scala Steward
commit fa43184ff5c4a4dc4027f373d4aa0b5cf8929d35
12 changes: 12 additions & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Original file line number Diff line number Diff line change
@@ -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' },
Original file line number Diff line number Diff line change
@@ -184,8 +184,8 @@ function ToggleGroupControlOptionBase(
* @example
* ```jsx
* import {
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOptionBase as ToggleGroupControlOptionBase,
* ToggleGroupControl,
* ToggleGroupControlOptionBase,
* } from '@wordpress/components';
*
* function Example() {
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';

Original file line number Diff line number Diff line change
@@ -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';
*
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() {
Original file line number Diff line number Diff line change
@@ -42,8 +42,8 @@ function UnforwardedToggleGroupControlOption(
*
* ```jsx
* import {
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOption as ToggleGroupControlOption,
* ToggleGroupControl,
* ToggleGroupControlOption,
* } from '@wordpress/components';
*
* function Example() {
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.
@@ -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() {
Original file line number Diff line number Diff line change
@@ -111,8 +111,8 @@ function UnconnectedToggleGroupControl(
*
* ```jsx
* import {
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOption as ToggleGroupControlOption,
* ToggleGroupControl,
* ToggleGroupControlOption,
* } from '@wordpress/components';
*
* function Example() {
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-/,