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

Storybook: Opt in to story store v7 #42486

Merged
merged 3 commits into from
Nov 21, 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import BlockLibrary from '../library';
import BlockEditorProvider from '../../provider';
import { patternCategories, patterns, reusableBlocks } from './fixtures';
import { patternCategories, patterns, reusableBlocks } from './utils/fixtures';
import Inserter from '../';

export default { title: 'BlockEditor/Inserter' };
Expand Down
12 changes: 6 additions & 6 deletions packages/components/src/navigation/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import NavigationBackButton from '../back-button';
import NavigationGroup from '../group';
import NavigationItem from '../item';
import NavigationMenu from '../menu';
import { DefaultStory } from './default';
import { GroupStory } from './group';
import { ControlledStateStory } from './controlled-state';
import { SearchStory } from './search';
import { MoreExamplesStory } from './more-examples';
import { HideIfEmptyStory } from './hide-if-empty';
import { DefaultStory } from './utils/default';
import { GroupStory } from './utils/group';
import { ControlledStateStory } from './utils/controlled-state';
import { SearchStory } from './utils/search';
import { MoreExamplesStory } from './utils/more-examples';
import { HideIfEmptyStory } from './utils/hide-if-empty';
import './style.css';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import Navigation from '..';
import NavigationItem from '../item';
import NavigationMenu from '../menu';
import Navigation from '../..';
import NavigationItem from '../../item';
import NavigationMenu from '../../menu';

export function ControlledStateStory() {
const [ activeItem, setActiveItem ] = useState( 'item-1' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import Navigation from '..';
import NavigationItem from '../item';
import NavigationMenu from '../menu';
import Navigation from '../..';
import NavigationItem from '../../item';
import NavigationMenu from '../../menu';

export function DefaultStory() {
const [ activeItem, setActiveItem ] = useState( 'item-1' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import Navigation from '..';
import NavigationItem from '../item';
import NavigationMenu from '../menu';
import NavigationGroup from '../group';
import Navigation from '../..';
import NavigationItem from '../../item';
import NavigationMenu from '../../menu';
import NavigationGroup from '../../group';

export function GroupStory() {
const [ activeItem, setActiveItem ] = useState( 'item-1' );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Internal dependencies
*/
import Navigation from '..';
import NavigationItem from '../item';
import NavigationMenu from '../menu';
import Navigation from '../..';
import NavigationItem from '../../item';
import NavigationMenu from '../../menu';

export function HideIfEmptyStory() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { Icon, wordpress, home } from '@wordpress/icons';
/**
* Internal dependencies
*/
import Navigation from '..';
import NavigationGroup from '../group';
import NavigationItem from '../item';
import NavigationMenu from '../menu';
import Navigation from '../..';
import NavigationGroup from '../../group';
import NavigationItem from '../../item';
import NavigationMenu from '../../menu';

export function MoreExamplesStory() {
const [ activeItem, setActiveItem ] = useState( 'child-1' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import Navigation from '..';
import NavigationGroup from '../group';
import NavigationItem from '../item';
import NavigationMenu from '../menu';
import { normalizedSearch } from '../utils';
import Navigation from '../..';
import NavigationGroup from '../../group';
import NavigationItem from '../../item';
import NavigationMenu from '../../menu';
import { normalizedSearch } from '../../utils';

const searchItems = [
{ item: 'foo', title: 'Foo' },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/tools-panel/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export const WithConditionallyRenderedControl = () => {
);
};

export { ToolsPanelWithItemGroupSlot } from './tools-panel-with-item-group-slot';
export { ToolsPanelWithItemGroupSlot } from './utils/tools-panel-with-item-group-slot';

const PanelWrapperView = styled.div`
font-size: 13px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ import { useContext, useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import Button from '../../button';
import ColorIndicator from '../../color-indicator';
import ColorPalette from '../../color-palette';
import Dropdown from '../../dropdown';
import Panel from '../../panel';
import { FlexItem } from '../../flex';
import { HStack } from '../../h-stack';
import { Item, ItemGroup } from '../../item-group';
import { ToolsPanel, ToolsPanelItem, ToolsPanelContext } from '..';
import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
import { useCx } from '../../utils';
import Button from '../../../button';
import ColorIndicator from '../../../color-indicator';
import ColorPalette from '../../../color-palette';
import Dropdown from '../../../dropdown';
import Panel from '../../../panel';
import { FlexItem } from '../../../flex';
import { HStack } from '../../../h-stack';
import { Item, ItemGroup } from '../../../item-group';
import { ToolsPanel, ToolsPanelItem, ToolsPanelContext } from '../..';
import {
createSlotFill,
Provider as SlotFillProvider,
} from '../../../slot-fill';
import { useCx } from '../../../utils';

// Available border colors.
const colors = [
Expand Down
4 changes: 2 additions & 2 deletions packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"src/**/*.ios.js",
"src/**/*.native.js",
"src/**/react-native-*",
"src/**/stories/**.js", // only exclude js files, tsx files should be checked
"src/**/test/**.js", // only exclude js files, ts{x} files should be checked
"src/**/stories/**/*.js", // only exclude js files, tsx files should be checked
"src/**/test/**/*.js", // only exclude js files, ts{x} files should be checked
Comment on lines +40 to +41
Copy link
Member

Choose a reason for hiding this comment

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

Wrong globbing!

"src/index.js",
"src/alignment-matrix-control",
"src/angle-picker-control",
Expand Down
2 changes: 2 additions & 0 deletions storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ module.exports = {
'@storybook/addon-toolbars',
'@storybook/addon-actions',
],
framework: '@storybook/react',
features: {
babelModeV7: true,
emotionAlias: false,
storyStoreV7: true,
},
// Workaround:
// https://github.com/storybookjs/storybook/issues/12270
Expand Down