Skip to content

Commit dbf2efc

Browse files
committed
Refactor Typography props
1 parent 807d3b3 commit dbf2efc

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
import { Story } from "@storybook/react";
2-
import {
3-
TemplateVersionWarnings,
4-
TemplateVersionWarningsProps,
5-
} from "./TemplateVersionWarnings";
1+
import { TemplateVersionWarnings } from "./TemplateVersionWarnings";
2+
import type { Meta, StoryObj } from "@storybook/react";
63

7-
export default {
4+
const meta: Meta<typeof TemplateVersionWarnings> = {
85
title: "components/TemplateVersionWarnings",
96
component: TemplateVersionWarnings,
107
};
118

12-
const Template: Story<TemplateVersionWarningsProps> = (args) => (
13-
<TemplateVersionWarnings {...args} />
14-
);
9+
export default meta;
10+
type Story = StoryObj<typeof TemplateVersionWarnings>;
1511

16-
export const UnsupportedWorkspaces = Template.bind({});
17-
UnsupportedWorkspaces.args = {
18-
warnings: ["UNSUPPORTED_WORKSPACES"],
12+
export const UnsupportedWorkspaces: Story = {
13+
args: {
14+
warnings: ["UNSUPPORTED_WORKSPACES"],
15+
},
1916
};
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { Story } from "@storybook/react";
2-
import { Typography, TypographyProps } from "./Typography";
1+
import { Typography } from "./Typography";
2+
import type { Meta, StoryObj } from "@storybook/react";
33

4-
export default {
4+
const meta: Meta<typeof Typography> = {
55
title: "components/Typography",
66
component: Typography,
7+
args: {
8+
children: "Colorless green ideas sleep furiously",
9+
},
710
};
811

9-
const Template: Story<TypographyProps> = (args: TypographyProps) => (
10-
<>
11-
<Typography {...args}>Colorless green ideas sleep furiously</Typography>
12-
<Typography {...args}>
13-
More people have been to France than I have
14-
</Typography>
15-
</>
16-
);
12+
export default meta;
13+
type Story = StoryObj<typeof Typography>;
1714

18-
export const Short = Template.bind({});
19-
Short.args = {
20-
short: true,
15+
export const Short: Story = {
16+
args: {
17+
short: true,
18+
},
2119
};
22-
export const Tall = Template.bind({});
23-
Tall.args = {
24-
short: false,
20+
21+
export const Tall: Story = {
22+
args: {
23+
short: false,
24+
},
2525
};

0 commit comments

Comments
 (0)