Skip to content

Commit

Permalink
chore(storybook): move all component-level parameters from MDX to sto…
Browse files Browse the repository at this point in the history
…ry files

- Import MDX Meta blocks from `@storybook/blocks`
- Move any component-level parameters in MDX Meta blocks to story files
- Remove `info` parameter from MDX Meta blocks (was used by a removed addon)
- Remove parameters prop from MDX Meta blocks (no longer supported)
  • Loading branch information
Parsium committed Mar 20, 2024
1 parent 5b8a2c5 commit 37fdeb7
Show file tree
Hide file tree
Showing 133 changed files with 80 additions and 213 deletions.
2 changes: 1 addition & 1 deletion docs/bundle-size.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Documentation/Bundle Size" />

Expand Down
2 changes: 1 addition & 1 deletion docs/colors.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Documentation/Colors" />

Expand Down
2 changes: 1 addition & 1 deletion docs/component-dos-and-donts.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Documentation/Component Dos and Don'ts" />

Expand Down
2 changes: 1 addition & 1 deletion docs/extending-styles-using-styled-components.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas } from "@storybook/addon-docs";
import { Meta, Story, Canvas } from "@storybook/blocks";
import styled from "styled-components";
import Box from "../src/components/box";

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-contribute.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Contributing/How to contribute" />

Expand Down
2 changes: 1 addition & 1 deletion docs/i18n.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Documentation/i18n" />

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Getting Started/Installation" />

Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Contributing/Roadmap" />

Expand Down
2 changes: 1 addition & 1 deletion docs/usage-with-routing.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Documentation/Usage with routing" />

Expand Down
2 changes: 1 addition & 1 deletion docs/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta title="Getting Started/Usage" />

Expand Down
2 changes: 1 addition & 1 deletion docs/using-draft-js.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta } from "@storybook/blocks";

<Meta
title="Documentation/Using DraftJS"
Expand Down
6 changes: 1 addition & 5 deletions docs/validations.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { Meta, Canvas } from "@storybook/addon-docs";
import { Meta, Canvas } from "@storybook/blocks";

import * as ValidationsStories from "./validations.stories";

<Meta
title="Documentation/Validations"
parameters={{
info: { disable: true },
chromatic: { disableSnapshot: true },
}}
of={ValidationsStories}
/>

Expand Down
3 changes: 3 additions & 0 deletions docs/validations.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { RadioButton, RadioButtonGroup } from "../src/components/radio-button";
const meta: Meta = {
title: "Documentation/Validations",
tags: ["hideInSidebar"],
parameters: {
chromatic: { disableSnapshot: true },
},
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/accordion/accordion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as AccordionGroupStories from "./accordion-group/accordion-group.storie

<Meta
title="Accordion"
parameters={{ info: { disable: true } }}
of={AccordionStories}
/>

Expand Down
1 change: 0 additions & 1 deletion src/components/action-popover/action-popover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as ActionPopoverStories from "./action-popover.stories";

<Meta
title="Action Popover"
parameters={{ info: { disable: true }, chromatic: { disableSnapshot: true } }}
of={ActionPopoverStories}
/>

Expand Down
1 change: 1 addition & 0 deletions src/components/action-popover/action-popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const meta: Meta<typeof ActionPopover> = {
argTypes: {
...styledSystemProps,
},
parameters: { chromatic: { disableSnapshot: true } },
};

export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as AdvancedColorPickerStories from "./advanced-color-picker.stories";

<Meta
title="Advanced Color Picker"
parameters={{ info: { disable: true } }}
of={AdvancedColorPickerStories}
/>

Expand Down
6 changes: 1 addition & 5 deletions src/components/alert/alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import * as AlertStories from "./alert.stories";

<Meta
title="Alert"
parameters={{
info: { disable: true },
themeProvider: { chromatic: { theme: "sage" } },
}}
of={AlertStories}
of={AlertStories}
/>

# Alert
Expand Down
1 change: 1 addition & 0 deletions src/components/alert/alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import isChromatic from "../../../.storybook/isChromatic";
const meta: Meta<typeof Alert> = {
title: "Alert",
component: Alert,
parameters: { themeProvider: { chromatic: { theme: "sage" } } },
};

export default meta;
Expand Down
6 changes: 1 addition & 5 deletions src/components/anchor-navigation/anchor-navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import * as AnchorNavigationStories from "./anchor-navigation.stories";

<Meta
title="Anchor Navigation"
parameters={{
info: { disable: true },
chromatic: { disableSnapshot: true },
}}
of={AnchorNavigationStories}
of={AnchorNavigationStories}
/>

# Anchor Navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {
const meta: Meta<typeof AnchorNavigation> = {
component: AnchorNavigation,
title: "Anchor Navigation",
parameters: {
chromatic: { disableSnapshot: true },
},
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/badge/badge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as BadgeStories from "./badge.stories";

<Meta
title="Badge"
parameters={{ info: { disable: true } }}
of={BadgeStories}
/>

Expand Down
1 change: 0 additions & 1 deletion src/components/batch-selection/batch-selection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as BatchSelectionStories from "./batch-selection.stories";

<Meta
title="Batch Selection"
parameters={{ info: { disable: true } }}
of={BatchSelectionStories}
/>

Expand Down
2 changes: 1 addition & 1 deletion src/components/box/box.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Meta, ArgTypes, Canvas } from "@storybook/blocks";

import * as BoxStories from "./box.stories";

<Meta title="Box" parameters={{ info: { disable: true } }} of={BoxStories} />
<Meta title="Box" of={BoxStories} />

# Box

Expand Down
1 change: 0 additions & 1 deletion src/components/breadcrumbs/breadcrumbs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as BreadcrumbsStories from "./breadcrumbs.stories.tsx";

<Meta
title="Breadcrumbs"
parameters={{ info: { disable: true } }}
of={BreadcrumbsStories}
/>

Expand Down
1 change: 0 additions & 1 deletion src/components/button-bar/button-bar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as ButtonBarStories from "./button-bar.stories";

<Meta
title="Button Bar"
parameters={{ info: { disable: true }, chromatic: { disableSnapshot: true } }}
of={ButtonBarStories}
/>

Expand Down
1 change: 1 addition & 0 deletions src/components/button-bar/button-bar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const meta: Meta<typeof ButtonBar> = {
argTypes: {
...styledSystemProps,
},
parameters: { chromatic: { disableSnapshot: true } },
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/button-minor/button-minor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as ButtonMinorStories from "./button-minor.stories";

<Meta
title="Button Minor"
parameters={{ info: { disable: true } }}
of={ButtonMinorStories}
/>

Expand Down
6 changes: 1 addition & 5 deletions src/components/button-toggle/button-toggle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import * as ButtonToggleGroupStories from "./button-toggle-group/button-toggle-g

<Meta
title="Button Toggle"
parameters={{
info: { disable: true },
themeProvider: { chromatic: { theme: "sage" } },
}}
of={ButtonToggleStories}
of={ButtonToggleStories}
/>

# Button Toggle
Expand Down
1 change: 1 addition & 0 deletions src/components/button-toggle/button-toggle.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Box from "../box";
const meta: Meta<typeof ButtonToggle> = {
title: "Button Toggle",
component: ButtonToggle,
parameters: { themeProvider: { chromatic: { theme: "sage" } } },
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/button/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as ButtonStories from "./button.stories";

<Meta
title="Button"
parameters={{ info: { disable: true }, chromatic: { disableSnapshot: true } }}
of={ButtonStories}
/>

Expand Down
1 change: 1 addition & 0 deletions src/components/button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const meta: Meta<typeof Button> = {
argTypes: {
...styledSystemProps,
},
parameters: { chromatic: { disableSnapshot: true } },
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/carbon-provider/carbon-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as CarbonProviderStories from "./carbon-provider.stories";

<Meta
title="Carbon Provider"
parameters={{ info: { disable: true }, chromatic: { disableSnapshot: true } }}
of={CarbonProviderStories}
/>

Expand Down
1 change: 1 addition & 0 deletions src/components/carbon-provider/carbon-provider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { sageTheme, mintTheme } from "../../style/themes";
const meta: Meta<typeof CarbonProvider> = {
title: "Carbon Provider",
component: CarbonProvider,
parameters: { chromatic: { disableSnapshot: true } },
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/card/card.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as CardRowStories from "./card-row/card-row.stories";

<Meta
title="Card"
parameters={{ info: { disable: true }, controls: { disable: true } }}
of={CardStories}
/>

Expand Down
1 change: 1 addition & 0 deletions src/components/card/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const meta: Meta<typeof Card> = {
argTypes: {
...styledSystemProps,
},
parameters: { controls: { disable: true } },
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/carousel/carousel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as CarouselStories from "./carousel.stories";

<Meta
title="Carousel"
parameters={{ info: { disable: true } }}
of={CarouselStories}
/>

Expand Down
1 change: 0 additions & 1 deletion src/components/checkbox/checkbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as ValidationStories from "./validations.stories";

<Meta
title="Checkbox"
parameters={{ info: { disable: true } }}
of={CheckboxStories}
/>

Expand Down
6 changes: 1 addition & 5 deletions src/components/confirm/confirm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import * as ConfirmStories from "./confirm.stories";

<Meta
title="Confirm"
parameters={{
info: { disable: true },
themeProvider: { chromatic: { theme: "sage" } },
}}
of={ConfirmStories}
of={ConfirmStories}
/>

# Confirm
Expand Down
1 change: 1 addition & 0 deletions src/components/confirm/confirm.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import isChromatic from "../../../.storybook/isChromatic";
const meta: Meta<typeof Confirm> = {
title: "Confirm",
component: Confirm,
parameters: { themeProvider: { chromatic: { theme: "sage" } } },
};

export default meta;
Expand Down
43 changes: 0 additions & 43 deletions src/components/content/content-test.stories.mdx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/content/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as ContentStories from "./content.stories.tsx";

<Meta
title="Content"
parameters={{ info: { disable: true }, controls: { disabled: true } }}
of={ContentStories}
/>

Expand Down
1 change: 1 addition & 0 deletions src/components/content/content.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const meta: Meta<typeof Content> = {
argTypes: {
...styledSystemProps,
},
parameters: { controls: { disabled: true } },
};

export default meta;
Expand Down
1 change: 0 additions & 1 deletion src/components/date-range/date-range.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as DateRangeStories from "./date-range.stories";

<Meta
title="Date Range"
parameters={{ info: { disable: true } }}
of={DateRangeStories}
/>

Expand Down
Loading

0 comments on commit 37fdeb7

Please sign in to comment.