11import React from 'react' ;
2- import { Image , Radio , Select , Switch } from '@tiny-design/react' ;
2+ import { Flex , Image , Radio , Select , Switch } from '@tiny-design/react' ;
33
44const OBJECT_FIT_OPTIONS = [ 'cover' , 'contain' , 'fill' , 'none' , 'scale-down' ] as const ;
55
@@ -87,13 +87,12 @@ export default function ImageStyleDemo() {
8787 const previewHeight = round ? 160 : 120 ;
8888
8989 return (
90- < div style = { { display : 'grid' , gap : 18 } } >
91- < div
90+ < Flex vertical gap = { 18 } >
91+ < Flex
92+ wrap = "wrap"
93+ align = "center"
94+ gap = { 16 }
9295 style = { {
93- display : 'flex' ,
94- flexWrap : 'wrap' ,
95- alignItems : 'center' ,
96- gap : 16 ,
9796 padding : 16 ,
9897 border : '1px solid #e2e8f0' ,
9998 borderRadius : 12 ,
@@ -116,16 +115,16 @@ export default function ImageStyleDemo() {
116115 < Select value = { objectPosition } onChange = { ( value ) => setObjectPosition ( String ( value ) ) } options = { focusOptions } />
117116 </ div >
118117
119- < div style = { { display : 'grid' , gap : 8 } } >
118+ < Flex vertical gap = { 8 } >
120119 < div style = { { fontSize : 12 , color : '#64748b' , fontWeight : 600 } } > Round preview</ div >
121120 < Switch checked = { round } onChange = { setRound } />
122- </ div >
123- </ div >
121+ </ Flex >
122+ </ Flex >
124123
125- < div style = { { display : 'grid' , gap : 8 } } >
124+ < Flex vertical gap = { 8 } >
126125 < div style = { { fontSize : 12 , fontWeight : 600 , color : '#64748b' } } > Interactive comparison</ div >
127- < div style = { { display : 'flex' , gap : 16 , flexWrap : ' wrap' , alignItems : ' flex-start' } } >
128- < div style = { { display : 'grid' , gap : 8 } } >
126+ < Flex gap = { 16 } wrap = "wrap" align = " flex-start" >
127+ < Flex vertical gap = { 8 } >
129128 < div style = { { fontSize : 12 , color : '#64748b' } } > Tall graphic in a wide frame</ div >
130129 < Image
131130 width = { previewWidth }
@@ -141,9 +140,9 @@ export default function ImageStyleDemo() {
141140 Best for comparing < code > cover</ code > , < code > contain</ code > , < code > none</ code > , and
142141 < code > scale-down</ code > . Changing the focal point moves the visible band.
143142 </ div >
144- </ div >
143+ </ Flex >
145144
146- < div style = { { display : 'grid' , gap : 8 } } >
145+ < Flex vertical gap = { 8 } >
147146 < div style = { { fontSize : 12 , color : '#64748b' } } > Square graphic in a wide frame</ div >
148147 < Image
149148 width = { previewWidth }
@@ -158,9 +157,9 @@ export default function ImageStyleDemo() {
158157 Best for spotting < code > fill</ code > : < code > contain</ code > keeps a centered square, while
159158 < code > fill</ code > stretches the circle and square across the whole frame.
160159 </ div >
161- </ div >
160+ </ Flex >
162161
163- < div style = { { display : 'grid' , gap : 8 } } >
162+ < Flex vertical gap = { 8 } >
164163 < div style = { { fontSize : 12 , color : '#64748b' } } > Small asset in a large frame</ div >
165164 < Image
166165 width = { previewWidth }
@@ -175,13 +174,13 @@ export default function ImageStyleDemo() {
175174 Useful for seeing why < code > scale-down</ code > often matches < code > none</ code > when the source is
176175 already smaller than the frame.
177176 </ div >
178- </ div >
179- </ div >
177+ </ Flex >
178+ </ Flex >
180179 < div style = { { color : '#64748b' , fontSize : 13 , lineHeight : 1.5 } } >
181180 Use the tall preview for crop behavior, the square preview for stretch behavior, and the small preview for
182181 < code > none</ code > versus < code > scale-down</ code > .
183182 </ div >
184- </ div >
185- </ div >
183+ </ Flex >
184+ </ Flex >
186185 ) ;
187186}
0 commit comments