55import type { Meta , StoryObj } from "@storybook/react-vite" ;
66import { storybookLayoutDecorator , StoryLabel } from "@storybook-common" ;
77
8+ import { Flex } from "@blueprintjs/labs" ;
9+
810import { Alignment , ButtonVariant , Intent , Size } from "../../common" ;
911
1012import { Button } from "./buttons" ;
@@ -116,7 +118,7 @@ export const IntentExample: Story = {
116118 intent : { table : { disable : true } } ,
117119 } ,
118120 render : args => (
119- < div style = { { display : "flex" , gap : 8 } } >
121+ < Flex gap = { 2 } >
120122 { Object . values ( Intent )
121123 . filter ( i => i !== "none" )
122124 . map ( intent => (
@@ -127,7 +129,7 @@ export const IntentExample: Story = {
127129 text = { intent . charAt ( 0 ) . toUpperCase ( ) + intent . slice ( 1 ) }
128130 />
129131 ) ) }
130- </ div >
132+ </ Flex >
131133 ) ,
132134} ;
133135
@@ -141,7 +143,7 @@ export const VariantExample: Story = {
141143 variant : { table : { disable : true } } ,
142144 } ,
143145 render : args => (
144- < div style = { { display : "flex" , gap : 8 } } >
146+ < Flex gap = { 2 } >
145147 { Object . values ( ButtonVariant ) . map ( variant => (
146148 < Button
147149 key = { variant }
@@ -150,7 +152,7 @@ export const VariantExample: Story = {
150152 text = { variant . charAt ( 0 ) . toUpperCase ( ) + variant . slice ( 1 ) }
151153 />
152154 ) ) }
153- </ div >
155+ </ Flex >
154156 ) ,
155157} ;
156158
@@ -163,11 +165,11 @@ export const SizeExample: Story = {
163165 size : { table : { disable : true } } ,
164166 } ,
165167 render : args => (
166- < div style = { { display : "flex" , gap : 8 , alignItems : "center" } } >
168+ < Flex gap = { 2 } alignItems = "center" >
167169 { Object . values ( Size ) . map ( size => (
168170 < Button key = { size } { ...args } size = { size } text = { size . charAt ( 0 ) . toUpperCase ( ) + size . slice ( 1 ) } />
169171 ) ) }
170- </ div >
172+ </ Flex >
171173 ) ,
172174} ;
173175
@@ -182,12 +184,12 @@ export const StateExample: Story = {
182184 loading : { table : { disable : true } } ,
183185 } ,
184186 render : args => (
185- < div style = { { display : "flex" , gap : 8 } } >
187+ < Flex gap = { 2 } >
186188 < Button { ...args } text = "Default" />
187189 < Button { ...args } active = { true } text = "Active" />
188190 < Button { ...args } disabled = { true } text = "Disabled" />
189191 < Button { ...args } loading = { true } text = "Loading" />
190- </ div >
192+ </ Flex >
191193 ) ,
192194} ;
193195
@@ -201,12 +203,12 @@ export const IconExample: Story = {
201203 endIcon : { table : { disable : true } } ,
202204 } ,
203205 render : args => (
204- < div style = { { display : "flex" , gap : 8 } } >
206+ < Flex gap = { 2 } >
205207 < Button { ...args } icon = "refresh" text = "Reset" />
206208 < Button { ...args } icon = "user" endIcon = "caret-down" text = "Profile" />
207209 < Button { ...args } endIcon = "arrow-right" text = "Next" />
208210 < Button { ...args } icon = "edit" text = { undefined } aria-label = "edit" />
209- </ div >
211+ </ Flex >
210212 ) ,
211213} ;
212214
@@ -219,7 +221,7 @@ export const AlignmentExample: Story = {
219221 alignText : { table : { disable : true } } ,
220222 } ,
221223 render : args => (
222- < div style = { { display : "flex" , flexDirection : " column", gap : 8 , minWidth : 300 } } >
224+ < Flex flexDirection = " column" gap = { 2 } style = { { minWidth : 300 } } >
223225 { Object . values ( Alignment ) . map ( alignment => (
224226 < Button
225227 key = { alignment }
@@ -230,7 +232,7 @@ export const AlignmentExample: Story = {
230232 text = { alignment . charAt ( 0 ) . toUpperCase ( ) + alignment . slice ( 1 ) }
231233 />
232234 ) ) }
233- </ div >
235+ </ Flex >
234236 ) ,
235237} ;
236238
@@ -250,10 +252,10 @@ export const FillExample: Story = {
250252 ) ,
251253 ] ,
252254 render : args => (
253- < div style = { { display : "flex" , flexDirection : " column", gap : 8 } } >
255+ < Flex flexDirection = " column" gap = { 2 } >
254256 < Button { ...args } fill = { true } text = "Full Width" />
255257 < Button { ...args } fill = { false } text = "Auto Width" />
256- </ div >
258+ </ Flex >
257259 ) ,
258260} ;
259261
@@ -269,16 +271,16 @@ export const AllIntentsAllVariants: Story = {
269271 loading : { table : { disable : true } } ,
270272 } ,
271273 render : args => (
272- < div style = { { display : "flex" , flexDirection : " column", gap : 16 } } >
274+ < Flex flexDirection = " column" gap = { 4 } >
273275 { Object . values ( ButtonVariant ) . map ( variant => (
274- < div key = { variant } style = { { display : "flex" , flexDirection : " column", gap : 8 } } >
276+ < Flex key = { variant } flexDirection = " column" gap = { 2 } >
275277 < StoryLabel title = { variant } />
276- < div style = { { display : "flex" , gap : 8 } } >
278+ < Flex gap = { 2 } >
277279 { Object . values ( Intent ) . map ( intent => (
278280 < Button key = { intent } { ...args } variant = { variant } intent = { intent } text = { intent } />
279281 ) ) }
280- </ div >
281- < div style = { { display : "flex" , gap : 8 } } >
282+ </ Flex >
283+ < Flex gap = { 2 } >
282284 { Object . values ( Intent ) . map ( intent => (
283285 < Button
284286 key = { intent }
@@ -289,8 +291,8 @@ export const AllIntentsAllVariants: Story = {
289291 text = { intent }
290292 />
291293 ) ) }
292- </ div >
293- < div style = { { display : "flex" , gap : 8 } } >
294+ </ Flex >
295+ < Flex gap = { 2 } >
294296 { Object . values ( Intent ) . map ( intent => (
295297 < Button
296298 key = { intent }
@@ -301,8 +303,8 @@ export const AllIntentsAllVariants: Story = {
301303 text = { intent }
302304 />
303305 ) ) }
304- </ div >
305- < div style = { { display : "flex" , gap : 8 } } >
306+ </ Flex >
307+ < Flex gap = { 2 } >
306308 { Object . values ( Intent ) . map ( intent => (
307309 < Button
308310 key = { intent }
@@ -313,10 +315,10 @@ export const AllIntentsAllVariants: Story = {
313315 text = { intent }
314316 />
315317 ) ) }
316- </ div >
317- </ div >
318+ </ Flex >
319+ </ Flex >
318320 ) ) }
319- </ div >
321+ </ Flex >
320322 ) ,
321323} ;
322324
0 commit comments