File tree 1 file changed +45
-36
lines changed 1 file changed +45
-36
lines changed Original file line number Diff line number Diff line change 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 " ;
3
3
4
- export default {
4
+ const meta : Meta < typeof Pill > = {
5
5
title : "components/Pill" ,
6
6
component : Pill ,
7
7
} ;
8
8
9
- const Template : Story < PillProps > = ( args ) => < Pill { ...args } /> ;
9
+ export default meta ;
10
+ type Story = StoryObj < typeof Pill > ;
10
11
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
+ } ,
15
17
} ;
16
18
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
+ } ,
21
24
} ;
22
25
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
+ } ,
27
31
} ;
28
32
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
+ } ,
33
38
} ;
34
39
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
+ } ,
39
45
} ;
40
46
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
+ } ,
45
52
} ;
46
53
47
- export const Default = Template . bind ( { } ) ;
48
- Default . args = {
49
- text : "Default" ,
54
+ export const Default : Story = {
55
+ args : {
56
+ text : "Default" ,
57
+ } ,
50
58
} ;
51
59
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
+ } ,
57
66
} ;
You can’t perform that action at this time.
0 commit comments