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

Adds categories to Storybooks navigation #66072

Merged
merged 5 commits into from
Oct 16, 2024
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
3 changes: 2 additions & 1 deletion packages/components/src/button/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import './style.css';
import Button from '..';

const meta: Meta< typeof Button > = {
title: 'Components/Button',
title: 'Components/Actions/Button',
id: 'components-button',
component: Button,
argTypes: {
// Overrides a limitation of the docgen interpreting our TS types for this as required.
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/card/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const meta: Meta< typeof Card > = {
component: Card,
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
subcomponents: { CardHeader, CardBody, CardDivider, CardMedia, CardFooter },
title: 'Components/Card',
title: 'Components/Containers/Card',
id: 'components-card',
argTypes: {
as: {
control: { type: null },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import type { Meta, StoryFn } from '@storybook/react';
import { NavigableMenu } from '..';

const meta: Meta< typeof NavigableMenu > = {
title: 'Components/NavigableMenu',
title: 'Components/Containers/NavigableMenu',
id: 'components-navigablemenu',
component: NavigableMenu,
argTypes: {
children: { control: { type: null } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import type { Meta, StoryFn } from '@storybook/react';
import { TabbableContainer } from '..';

const meta: Meta< typeof TabbableContainer > = {
title: 'Components/TabbableContainer',
title: 'Components/Containers/TabbableContainer',
id: 'components-tabbablecontainer',
component: TabbableContainer,
argTypes: {
children: { control: { type: null } },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/panel/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import InputControl from '../../input-control';
import { wordpress } from '@wordpress/icons';

const meta: Meta< typeof Panel > = {
title: 'Components/Panel',
title: 'Components/Containers/Panel',
id: 'components-panel',
component: Panel,
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
subcomponents: { PanelRow, PanelBody },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/tab-panel/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { link, more, wordpress } from '@wordpress/icons';
import TabPanel from '..';

const meta: Meta< typeof TabPanel > = {
title: 'Components/TabPanel',
title: 'Components/Containers/TabPanel',
id: 'components-tabpanel',
component: TabPanel,
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/tabs/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import Tooltip from '../../tooltip';
import Icon from '../../icon';

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

Choose a reason for hiding this comment

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

In most cases, we can't just move components under the Experimental grouping because there are other administrative things that need to be done.

But in this case, since it's a "private" component, we can do so by just adding a redirect (aeec693) so the previous permalink (http://localhost:50240/?path=/docs/components-experimental-tabs--docs) redirects to the new one 👍

title: 'Components/Containers/Tabs',
id: 'components-tabs',
component: Tabs,
subcomponents: {
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
Expand Down
1 change: 1 addition & 0 deletions storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'navigation',
'navigator',
'progressbar',
'tabs',
'theme',
];
const REDIRECTS = [
Expand Down
6 changes: 6 additions & 0 deletions storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ export const parameters = {
'Playground',
'BlockEditor',
'Components',
[
'Introduction',
'Contributing Guidelines',
'Actions',
'Containers',
],
'Components (Experimental)',
'Icons',
],
Expand Down
Loading