@@ -7,46 +7,65 @@ import placeholderAvatar from '../fixtures/images/avatar-mona.png'
7
7
export default {
8
8
title : 'Components/Avatar' ,
9
9
component : Avatar ,
10
- args : {
11
- size : AvatarSizes [ 1 ] ,
12
- shape : 'circle' ,
13
- src : placeholderAvatar ,
14
- alt : 'A random avatar picture' ,
15
- } ,
16
- argTypes : {
17
- size : {
18
- description : 'The size of the Avatar' ,
19
- control : {
20
- type : 'radio' ,
21
- options : AvatarSizes ,
22
- } ,
10
+ } as Meta < typeof Avatar >
11
+
12
+ export const Default = ( ) => (
13
+ < Avatar src = "https://avatars.githubusercontent.com/u/92997159?v=4" alt = "A random avatar picture" />
14
+ )
15
+
16
+ export const Playground : StoryFn < typeof Avatar > = args => < Avatar { ... args } />
17
+ Playground . argTypes = {
18
+ shape : {
19
+ description : 'The shape of the Avatar' ,
20
+ options : AvatarShapes ,
21
+ control : {
22
+ type : 'radio' ,
23
23
} ,
24
- shape : {
25
- description : 'The shape of the Avatar' ,
26
- control : {
27
- type : 'radio' ,
28
- options : AvatarShapes ,
29
- } ,
24
+ } ,
25
+ src : {
26
+ description : 'The url of the image to display' ,
27
+ type : { name : 'string' , required : true } ,
28
+ control : {
29
+ type : 'text' ,
30
30
} ,
31
- src : {
32
- description : 'The url of the image to display' ,
33
- type : { name : 'string' , required : true } ,
34
- control : {
35
- type : 'text' ,
36
- } ,
31
+ } ,
32
+ alt : {
33
+ description : 'The alt text for the image' ,
34
+ type : { name : 'string' , required : true } ,
35
+ control : {
36
+ type : 'text' ,
37
37
} ,
38
- alt : {
39
- description : 'The alt text for the image' ,
40
- type : { name : 'string' , required : true } ,
41
- control : {
42
- type : 'text' ,
43
- } ,
38
+ } ,
39
+ size : {
40
+ description : 'The size of the Avatar' ,
41
+ options : AvatarSizes ,
42
+ control : {
43
+ type : 'radio' ,
44
44
} ,
45
45
} ,
46
- } as Meta < typeof Avatar >
46
+ }
47
+ Playground . args = {
48
+ shape : 'circle' ,
49
+ src : placeholderAvatar ,
50
+ alt : 'A random avatar picture' ,
51
+ size : AvatarSizes [ 1 ] ,
52
+ }
47
53
48
- export const Playground : StoryFn < typeof Avatar > = args => < Avatar { ...args } />
49
-
50
- export const Default = ( ) => (
51
- < Avatar src = "https://avatars.githubusercontent.com/u/92997159?v=4" alt = "A random avatar picture" />
52
- )
54
+ export const Playground2 : StoryFn < typeof Avatar > = args => < Avatar { ...args } />
55
+ Playground2 . argTypes = {
56
+ ...Playground . argTypes ,
57
+ size : {
58
+ control : {
59
+ type : 'object' ,
60
+ } ,
61
+ } ,
62
+ }
63
+ Playground2 . args = {
64
+ ...Playground . args ,
65
+ size : {
66
+ narrow : AvatarSizes [ 1 ] ,
67
+ regular : AvatarSizes [ 2 ] ,
68
+ wide : AvatarSizes [ 3 ] ,
69
+ } ,
70
+ }
71
+ Playground2 . storyName = 'Playground (responsive)'
0 commit comments