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 Navigator #60927

Closed
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
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Deprecation

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

## 27.4.0 (2024-04-19)

### Deprecation
Expand Down
24 changes: 24 additions & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,36 @@ export { default as __experimentalNavigationGroup } from './navigation/group';
export { default as __experimentalNavigationItem } from './navigation/item';
export { default as __experimentalNavigationMenu } from './navigation/menu';
export {
/**
* @deprecated Import `NavigatorProvider` instead.
*/
NavigatorProvider as __experimentalNavigatorProvider,
/**
* @deprecated Import `NavigatorScreen` instead.
*/
NavigatorScreen as __experimentalNavigatorScreen,
/**
* @deprecated Import `NavigatorButton` instead.
*/
NavigatorButton as __experimentalNavigatorButton,
/**
* @deprecated Import `NavigatorBackButton` instead.
*/
NavigatorBackButton as __experimentalNavigatorBackButton,
/**
* @deprecated Import `NavigatorToParentButton` instead.
*/
NavigatorToParentButton as __experimentalNavigatorToParentButton,
/**
* @deprecated Import `useNavigator` instead.
*/
useNavigator as __experimentalUseNavigator,
NavigatorProvider,
NavigatorScreen,
NavigatorButton,
NavigatorBackButton,
NavigatorToParentButton,
useNavigator,
} from './navigator';
export { default as Notice } from './notice';
export { default as __experimentalNumberControl } from './number-control';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# `NavigatorBackButton`

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

The `NavigatorBackButton` component can be used to navigate to a screen and should be used in combination with the [`NavigatorProvider`](/packages/components/src/navigator/navigator-provider/README.md), the [`NavigatorScreen`](/packages/components/src/navigator/navigator-screen/README.md) and the [`NavigatorButton`](/packages/components/src/navigator/navigator-button/README.md) components (or the `useNavigator` hook).

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ function UnconnectedNavigatorBackButton(
* @example
* ```jsx
* import {
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorBackButton as NavigatorBackButton,
* NavigatorProvider,
* NavigatorScreen,
* NavigatorButton,
* NavigatorBackButton,
* } from '@wordpress/components';
*
* const MyNavigation = () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# `NavigatorButton`

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

The `NavigatorButton` component can be used to navigate to a screen and should be used in combination with the [`NavigatorProvider`](/packages/components/src/navigator/navigator-provider/README.md), the [`NavigatorScreen`](/packages/components/src/navigator/navigator-screen/README.md) and the [`NavigatorBackButton`](/packages/components/src/navigator/navigator-back-button/README.md) components (or the `useNavigator` hook).

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ function UnconnectedNavigatorButton(
* @example
* ```jsx
* import {
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorBackButton as NavigatorBackButton,
* NavigatorProvider,
* NavigatorScreen,
* NavigatorButton,
* NavigatorBackButton,
* } from '@wordpress/components';
*
* const MyNavigation = () => (
Expand Down
12 changes: 4 additions & 8 deletions packages/components/src/navigator/navigator-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# `NavigatorProvider`

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

The `NavigatorProvider` component allows rendering nested views/panels/menus (via the [`NavigatorScreen` component](/packages/components/src/navigator/navigator-screen/README.md)) and navigate between these different states (via the [`NavigatorButton`](/packages/components/src/navigator/navigator-button/README.md), [`NavigatorToParentButton`](/packages/components/src/navigator/navigator-to-parent-button/README.md) and [`NavigatorBackButton`](/packages/components/src/navigator/navigator-back-button/README.md) components or the `useNavigator` hook). The Global Styles sidebar is an example of this.

## Usage

```jsx
import {
__experimentalNavigatorProvider as NavigatorProvider,
__experimentalNavigatorScreen as NavigatorScreen,
__experimentalNavigatorButton as NavigatorButton,
__experimentalNavigatorToParentButton as NavigatorToParentButton,
NavigatorProvider,
NavigatorScreen,
NavigatorButton,
NavigatorToParentButton,
} from '@wordpress/components';

const MyNavigation = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ function UnconnectedNavigatorProvider(
*
* ```jsx
* import {
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorBackButton as NavigatorBackButton,
* NavigatorProvider,
* NavigatorScreen,
* NavigatorButton,
* NavigatorBackButton,
* } from '@wordpress/components';
*
* const MyNavigation = () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# `NavigatorScreen`

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

The `NavigatorScreen` component represents a single view/screen/panel and should be used in combination with the [`NavigatorProvider`](/packages/components/src/navigator/navigator-provider/README.md), the [`NavigatorButton`](/packages/components/src/navigator/navigator-button/README.md) and the [`NavigatorBackButton`](/packages/components/src/navigator/navigator-back-button/README.md) components (or the `useNavigator` hook).

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ function UnconnectedNavigatorScreen(
* @example
* ```jsx
* import {
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorBackButton as NavigatorBackButton,
* NavigatorProvider,
* NavigatorScreen,
* NavigatorButton,
* NavigatorBackButton,
* } from '@wordpress/components';
*
* const MyNavigation = () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# `NavigatorToParentButton`

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

The `NavigatorToParentButton` component can be used to navigate to a screen and should be used in combination with the [`NavigatorProvider`](/packages/components/src/navigator/navigator-provider/README.md), the [`NavigatorScreen`](/packages/components/src/navigator/navigator-screen/README.md) and the [`NavigatorButton`](/packages/components/src/navigator/navigator-button/README.md) components (or the `useNavigator` hook).

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ function UnconnectedNavigatorToParentButton(
* @example
* ```jsx
* import {
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorToParentButton as NavigatorToParentButton,
* NavigatorProvider,
* NavigatorScreen,
* NavigatorButton,
* NavigatorToParentButton,
* } from '@wordpress/components';
*
* const MyNavigation = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const meta: Meta< typeof NavigatorProvider > = {
component: NavigatorProvider,
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
subcomponents: { NavigatorScreen, NavigatorButton, NavigatorBackButton },
title: 'Components (Experimental)/Navigator',
title: 'Components/Navigator',
argTypes: {
as: { control: { type: null } },
children: { control: { type: null } },
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',
'navigator',
];
const REDIRECTS = [
{
from: /\/components-deprecated-/,
Expand Down
Loading