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

Feat: Storybook: Improve component organisation - Overlays Category - Issue #66275 #66657

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 8 additions & 1 deletion packages/block-library/src/image/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"name": "core/image",
"title": "Image",
"category": "media",
"usesContext": [ "allowResize", "imageCrop", "fixedHeight", "postId", "postType", "queryId" ],
"usesContext": [
"allowResize",
"imageCrop",
"fixedHeight",
"postId",
"postType",
"queryId"
],
hbhalodia marked this conversation as resolved.
Show resolved Hide resolved
"description": "Insert an image to make a visual statement.",
"keywords": [ "img", "photo", "picture" ],
"textdomain": "default",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-content/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
},
"style": "wp-block-post-content",
"editorStyle": "wp-block-post-content-editor"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { ConfirmDialog } from '../component';

const meta: Meta< typeof ConfirmDialog > = {
component: ConfirmDialog,
title: 'Components (Experimental)/ConfirmDialog',
title: 'Components (Experimental)/Overlays/ConfirmDialog',
Copy link
Member

Choose a reason for hiding this comment

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

Another thing (cc @ciampo @mirka): experimental components will fall in their own section down below, meaning they will have their own Overlays directory. Is that desired? Should we consider marking the experimental components just with badges, like CustomSelectControlV2 is marked WIP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

experimental components will fall in their own section down below, meaning they will have their own Overlays directory

Waiting on this for confirmation.

Copy link
Member

Choose a reason for hiding this comment

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

I've been discussing this with @ciampo, and we concluded that it's a problem that can be solved separately.

In the future we may remove the "Experimental" distinction from the Storybook component list, and those categories that we're introducing will be on the top level. That being said, we could leave things as they are and ship this PR, and I've opened #66805 to discuss this separately.

id: 'components-experimental-confirmdialog',
argTypes: {
isOpen: {
control: { type: null },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/dropdown/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import MenuItem from '../../menu-item';
import { DropdownContentWrapper } from '../dropdown-content-wrapper';

const meta: Meta< typeof Dropdown > = {
title: 'Components/Dropdown',
title: 'Components/Overlays/Dropdown',
id: 'components-dropdown',
component: Dropdown,
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
subcomponents: { DropdownContentWrapper },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/modal/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import type { ModalProps } from '../types';

const meta: Meta< typeof Modal > = {
component: Modal,
title: 'Components/Modal',
title: 'Components/Overlays/Modal',
id: 'components-modal',
argTypes: {
children: {
control: { type: null },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/popover/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const AVAILABLE_PLACEMENTS: PopoverProps[ 'placement' ][] = [
];

const meta: Meta< typeof Popover > = {
title: 'Components/Popover',
title: 'Components/Overlays/Popover',
id: 'components-popover',
component: Popover,
argTypes: {
anchor: { control: { type: null } },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/tooltip/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import Tooltip from '..';
import Button from '../../button';

const meta: Meta< typeof Tooltip > = {
title: 'Components/Tooltip',
title: 'Components/Overlays/Tooltip',
id: 'components-tooltip',
component: Tooltip,
argTypes: {
children: { control: { type: null } },
Expand Down
2 changes: 2 additions & 0 deletions storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ export const parameters = {
'Actions',
'Containers',
'Feedback',
'Overlays',
'Utilities',
],
'Components (Experimental)',
[ 'Overlays' ],
'Icons',
],
},
Expand Down
Loading