@@ -2,21 +2,14 @@ import React from 'react'
2
2
import { Meta } from '@storybook/react'
3
3
import { Bento } from '.'
4
4
import { Link } from '../Link'
5
+ import placeholderImage from '../fixtures/images/placeholder-600x400.png'
5
6
6
7
import { CopilotIcon } from '@primer/octicons-react'
8
+ import { HeadingSizes , HeadingTags } from '../Heading'
7
9
8
10
export default {
9
11
title : 'Components/Bento' ,
10
12
component : Bento ,
11
- args : { } ,
12
- argTypes : {
13
- className : {
14
- description : 'Custom class name for the second component' ,
15
- control : {
16
- type : 'text' ,
17
- } ,
18
- } ,
19
- } ,
20
13
} as Meta < typeof Bento >
21
14
22
15
export const Default = ( ) => (
@@ -27,10 +20,195 @@ export const Default = () => (
27
20
Push what's possible with GitHub Copilot, the world's most trusted and widely adopted AI developer
28
21
tool.
29
22
</ Bento . Heading >
30
- < Link href = "#" variant = "default" >
31
- Learn more about Copilot
32
- </ Link >
23
+ < Link href = "#" > Learn more about Copilot</ Link >
33
24
</ Bento . Content >
34
25
</ Bento . Item >
35
26
</ Bento >
36
27
)
28
+
29
+ export const Playground = ( {
30
+ contentVisible,
31
+ contentLeadingVisualVisible,
32
+ contentLinkVisible,
33
+ contentPadding,
34
+ contentHorizontalAlign,
35
+ contentVerticalAlign,
36
+ headingText,
37
+ headingAs,
38
+ headingSize,
39
+ visualVisible,
40
+ visualFillMedia,
41
+ visualPosition,
42
+ visualPadding,
43
+ ...args
44
+ } ) => (
45
+ < Bento >
46
+ < Bento . Item { ...args } >
47
+ { contentVisible && (
48
+ < Bento . Content
49
+ leadingVisual = { contentLeadingVisualVisible && < CopilotIcon /> }
50
+ padding = { contentPadding }
51
+ horizontalAlign = { contentHorizontalAlign }
52
+ verticalAlign = { contentVerticalAlign }
53
+ >
54
+ < Bento . Heading as = { headingAs } size = { headingSize } >
55
+ { headingText }
56
+ </ Bento . Heading >
57
+ { contentLinkVisible && < Link href = "#" > Call to action</ Link > }
58
+ </ Bento . Content >
59
+ ) }
60
+
61
+ { visualVisible && (
62
+ < Bento . Visual fillMedia = { visualFillMedia } position = { visualPosition } padding = { visualPadding } >
63
+ < img alt = "placeholder, blank area with an gray background color" src = { placeholderImage } />
64
+ </ Bento . Visual >
65
+ ) }
66
+ </ Bento . Item >
67
+ </ Bento >
68
+ )
69
+ Playground . storyName = 'Playground'
70
+ Playground . args = {
71
+ flow : 'column' ,
72
+ colorMode : 'light' ,
73
+ visualAsBackground : false ,
74
+ order : 'default' ,
75
+ contentVisible : true ,
76
+ contentLeadingVisualVisible : true ,
77
+ contentLinkVisible : true ,
78
+ contentPadding : 'normal' ,
79
+ contentHorizontalAlign : 'start' ,
80
+ contentVerticalAlign : 'center' ,
81
+ headingText : 'Heading' ,
82
+ headingAs : 'h2' ,
83
+ headingSize : '3' ,
84
+ visualVisible : true ,
85
+ visualFillMedia : true ,
86
+ visualPosition : '50% 50%' ,
87
+ visualPadding : undefined ,
88
+ }
89
+ Playground . argTypes = {
90
+ flow : {
91
+ options : [ 'row' , 'column' ] ,
92
+ control : 'radio' ,
93
+ table : {
94
+ category : 'Bento.Item' ,
95
+ } ,
96
+ } ,
97
+ colorMode : {
98
+ options : [ 'light' , 'dark' ] ,
99
+ control : 'radio' ,
100
+ table : {
101
+ category : 'Bento.Item' ,
102
+ } ,
103
+ } ,
104
+ visualAsBackground : {
105
+ control : 'boolean' ,
106
+ table : {
107
+ category : 'Bento.Item' ,
108
+ } ,
109
+ } ,
110
+ order : {
111
+ options : [ 'default' , 'reverse' ] ,
112
+ control : 'radio' ,
113
+ table : {
114
+ category : 'Bento.Item' ,
115
+ } ,
116
+ } ,
117
+ contentVisible : {
118
+ name : 'visible' ,
119
+ control : 'boolean' ,
120
+ table : {
121
+ category : 'Bento.Content' ,
122
+ } ,
123
+ } ,
124
+ contentLeadingVisualVisible : {
125
+ name : 'leadingVisual visible' ,
126
+ control : 'boolean' ,
127
+ table : {
128
+ category : 'Bento.Content' ,
129
+ } ,
130
+ } ,
131
+ contentLinkVisible : {
132
+ name : 'Link visible' ,
133
+ control : 'boolean' ,
134
+ table : {
135
+ category : 'Bento.Content' ,
136
+ } ,
137
+ } ,
138
+ contentPadding : {
139
+ name : 'padding' ,
140
+ options : [ 'condensed' , 'normal' , 'spacious' ] ,
141
+ control : 'radio' ,
142
+ table : {
143
+ category : 'Bento.Content' ,
144
+ } ,
145
+ } ,
146
+ contentHorizontalAlign : {
147
+ name : 'horizontalAlign' ,
148
+ options : [ 'start' , 'center' , 'end' ] ,
149
+ control : 'inline-radio' ,
150
+ table : {
151
+ category : 'Bento.Content' ,
152
+ } ,
153
+ } ,
154
+ contentVerticalAlign : {
155
+ name : 'verticalAlign' ,
156
+ options : [ 'start' , 'center' , 'end' ] ,
157
+ control : 'inline-radio' ,
158
+ table : {
159
+ category : 'Bento.Content' ,
160
+ } ,
161
+ } ,
162
+ headingText : {
163
+ name : 'text' ,
164
+ control : 'text' ,
165
+ table : {
166
+ category : 'Bento.Heading' ,
167
+ } ,
168
+ } ,
169
+ headingAs : {
170
+ name : 'as' ,
171
+ control : 'inline-radio' ,
172
+ options : HeadingTags ,
173
+ table : {
174
+ category : 'Bento.Heading' ,
175
+ } ,
176
+ } ,
177
+ headingSize : {
178
+ name : 'size' ,
179
+ control : 'inline-radio' ,
180
+ options : HeadingSizes ,
181
+ table : {
182
+ category : 'Bento.Heading' ,
183
+ } ,
184
+ } ,
185
+ visualVisible : {
186
+ name : 'visible' ,
187
+ control : 'boolean' ,
188
+ table : {
189
+ category : 'Bento.Visual' ,
190
+ } ,
191
+ } ,
192
+ visualFillMedia : {
193
+ name : 'fillMedia' ,
194
+ control : 'boolean' ,
195
+ table : {
196
+ category : 'Bento.Visual' ,
197
+ } ,
198
+ } ,
199
+ visualPosition : {
200
+ name : 'position' ,
201
+ control : 'text' ,
202
+ table : {
203
+ category : 'Bento.Visual' ,
204
+ } ,
205
+ } ,
206
+ visualPadding : {
207
+ name : 'padding' ,
208
+ options : [ undefined , 'condensed' , 'normal' , 'spacious' ] ,
209
+ control : 'radio' ,
210
+ table : {
211
+ category : 'Bento.Visual' ,
212
+ } ,
213
+ } ,
214
+ }
0 commit comments