Skip to content

Commit df63af5

Browse files
committed
Refactor Pill stories
1 parent 899b08e commit df63af5

File tree

1 file changed

+45
-36
lines changed

1 file changed

+45
-36
lines changed
Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,66 @@
1-
import { Story } from "@storybook/react";
2-
import { Pill, PillProps } from "./Pill";
1+
import { Pill } from "./Pill";
2+
import type { Meta, StoryObj } from "@storybook/react";
33

4-
export default {
4+
const meta: Meta<typeof Pill> = {
55
title: "components/Pill",
66
component: Pill,
77
};
88

9-
const Template: Story<PillProps> = (args) => <Pill {...args} />;
9+
export default meta;
10+
type Story = StoryObj<typeof Pill>;
1011

11-
export const Primary = Template.bind({});
12-
Primary.args = {
13-
text: "Primary",
14-
type: "primary",
12+
export const Primary: Story = {
13+
args: {
14+
text: "Primary",
15+
type: "primary",
16+
},
1517
};
1618

17-
export const Secondary = Template.bind({});
18-
Secondary.args = {
19-
text: "Secondary",
20-
type: "secondary",
19+
export const Secondary: Story = {
20+
args: {
21+
text: "Secondary",
22+
type: "secondary",
23+
},
2124
};
2225

23-
export const Success = Template.bind({});
24-
Success.args = {
25-
text: "Success",
26-
type: "success",
26+
export const Success: Story = {
27+
args: {
28+
text: "Success",
29+
type: "success",
30+
},
2731
};
2832

29-
export const Info = Template.bind({});
30-
Info.args = {
31-
text: "Information",
32-
type: "info",
33+
export const Info: Story = {
34+
args: {
35+
text: "Information",
36+
type: "info",
37+
},
3338
};
3439

35-
export const Warning = Template.bind({});
36-
Warning.args = {
37-
text: "Warning",
38-
type: "warning",
40+
export const Warning: Story = {
41+
args: {
42+
text: "Warning",
43+
type: "warning",
44+
},
3945
};
4046

41-
export const Error = Template.bind({});
42-
Error.args = {
43-
text: "Error",
44-
type: "error",
47+
export const Error: Story = {
48+
args: {
49+
text: "Error",
50+
type: "error",
51+
},
4552
};
4653

47-
export const Default = Template.bind({});
48-
Default.args = {
49-
text: "Default",
54+
export const Default: Story = {
55+
args: {
56+
text: "Default",
57+
},
5058
};
5159

52-
export const WarningLight = Template.bind({});
53-
WarningLight.args = {
54-
text: "Warning",
55-
type: "warning",
56-
lightBorder: true,
60+
export const WarningLight: Story = {
61+
args: {
62+
text: "Warning",
63+
type: "warning",
64+
lightBorder: true,
65+
},
5766
};

0 commit comments

Comments
 (0)