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

Navigator: refactor Storybook code to TypeScript and controls #44979

Merged
merged 8 commits into from
Oct 17, 2022
Merged
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 @@ -5,6 +5,7 @@
### Bug Fix

- `FontSizePicker`: Ensure that fluid font size presets appear correctly in the UI controls ([#44791](https://github.com/WordPress/gutenberg/pull/44791)).
- `Navigator`: prevent partially hiding focus ring styles, by removing unnecessary overflow rules on `NavigatorScreen` ([#44973](https://github.com/WordPress/gutenberg/pull/44973)).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a note for #44973 since it wasn't added in the original PR

- `Navigator`: restore focus only once per location ([#44972](https://github.com/WordPress/gutenberg/pull/44972)).

### Documentation
Expand All @@ -16,6 +17,7 @@
- `Modal`: Convert to TypeScript ([#42949](https://github.com/WordPress/gutenberg/pull/42949)).
- `Sandbox`: Use `toString` to create observe and resize script string ([#42872](https://github.com/WordPress/gutenberg/pull/42872)).
- `Navigator`: refactor unit tests to TypeScript and to `user-event` ([#44970](https://github.com/WordPress/gutenberg/pull/44970)).
- `Navigator`: Refactor Storybook code to TypeScript and controls ([#44979](https://github.com/WordPress/gutenberg/pull/44979)).

## 21.2.0 (2022-10-05)

Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/navigator/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { default as NavigatorProvider } from './navigator-provider';
export { default as NavigatorScreen } from './navigator-screen';
export { default as NavigatorButton } from './navigator-button';
export { default as NavigatorBackButton } from './navigator-back-button';
export { NavigatorProvider } from './navigator-provider';
export { NavigatorScreen } from './navigator-screen';
export { NavigatorButton } from './navigator-button';
export { NavigatorBackButton } from './navigator-back-button';
export { default as useNavigator } from './use-navigator';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { View } from '../../view';
import { useNavigatorBackButton } from './hook';
import type { NavigatorBackButtonProps } from '../types';

function NavigatorBackButton(
function UnconnectedNavigatorBackButton(
props: WordPressComponentProps< NavigatorBackButtonProps, 'button' >,
forwardedRef: ForwardedRef< any >
) {
Expand Down Expand Up @@ -54,9 +54,9 @@ function NavigatorBackButton(
* );
* ```
*/
const ConnectedNavigatorBackButton = contextConnect(
NavigatorBackButton,
export const NavigatorBackButton = contextConnect(
UnconnectedNavigatorBackButton,
'NavigatorBackButton'
);

export default ConnectedNavigatorBackButton;
export default NavigatorBackButton;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './component';
export { default as NavigatorBackButton } from './component';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { View } from '../../view';
import { useNavigatorButton } from './hook';
import type { NavigatorButtonProps } from '../types';

function NavigatorButton(
function UnconnectedNavigatorButton(
props: WordPressComponentProps< NavigatorButtonProps, 'button' >,
forwardedRef: ForwardedRef< any >
) {
Expand Down Expand Up @@ -53,9 +53,9 @@ function NavigatorButton(
* );
* ```
*/
const ConnectedNavigatorButton = contextConnect(
NavigatorButton,
export const NavigatorButton = contextConnect(
UnconnectedNavigatorButton,
'NavigatorButton'
);

export default ConnectedNavigatorButton;
export default NavigatorButton;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './component';
export { default as NavigatorButton } from './component';
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type {
NavigatorContext as NavigatorContextType,
} from '../types';

function NavigatorProvider(
function UnconnectedNavigatorProvider(
props: WordPressComponentProps< NavigatorProviderProps, 'div' >,
forwardedRef: ForwardedRef< any >
) {
Expand Down Expand Up @@ -131,9 +131,9 @@ function NavigatorProvider(
* );
* ```
*/
const ConnectedNavigatorProvider = contextConnect(
NavigatorProvider,
export const NavigatorProvider = contextConnect(
UnconnectedNavigatorProvider,
'NavigatorProvider'
);

export default ConnectedNavigatorProvider;
export default NavigatorProvider;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './component';
export { default as NavigatorProvider } from './component';
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ type Props = Omit<
keyof MotionProps
>;

function NavigatorScreen( props: Props, forwardedRef: ForwardedRef< any > ) {
function UnconnectedNavigatorScreen(
props: Props,
forwardedRef: ForwardedRef< any >
) {
const { children, className, path, ...otherProps } = useContextSystem(
props,
'NavigatorScreen'
Expand Down Expand Up @@ -208,9 +211,9 @@ function NavigatorScreen( props: Props, forwardedRef: ForwardedRef< any > ) {
* );
* ```
*/
const ConnectedNavigatorScreen = contextConnect(
NavigatorScreen,
export const NavigatorScreen = contextConnect(
UnconnectedNavigatorScreen,
'NavigatorScreen'
);

export default ConnectedNavigatorScreen;
export default NavigatorScreen;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './component';
export { default as NavigatorScreen } from './component';
194 changes: 0 additions & 194 deletions packages/components/src/navigator/stories/index.js

This file was deleted.

Loading