@@ -12,73 +12,8 @@ export type ImageProps = React.ImgHTMLAttributes<HTMLImageElement> & {
1212 borderRadius ?: ImageBorderRadiusOptions
1313}
1414
15- < << << << HEAD
16- export const Image = ( { animate, as = 'img' , borderRadius, className, style, media, ...rest } : ImageProps ) => {
17- if ( as === 'picture' ) {
18- // @ts -expect-error Incorrect typings from legacy code. Keeping as-is to avoid modifying API
19- const { sources, srcSet, ...imgRest } = rest
20-
21- return (
22- < NewImage animate = { animate } as = { as } borderRadius = { borderRadius } className = { clsx ( className ) } style = { style } >
23- { sources
24- ? sources . map ( ( source , index ) => < source key = { index } srcSet = { source . srcset } media = { source . media } /> )
25- : null }
26- { srcSet && < source srcSet = { srcSet } media = { media } /> }
27- < img
28- ref = { ref }
29- alt = { alt }
30- width = { width ?? '100%' }
31- height = { height ?? '100%' }
32- className = { clsx ( styles . Image , borderRadius && styles [ `Image--borderRadius-${ borderRadius } ` ] , className ) }
33- { ...objectWithoutKey ( rest , 'sources' ) }
34- />
35- </ picture >
36- )
37- }
38- if ( aspectRatio ) {
39- return (
40- < span
41- className = { clsx ( styles [ 'Image__container' ] , styles [ `Image--aspect-ratio-${ aspectRatioResolver ( aspectRatio ) } ` ] ) }
42- >
43- < img
44- ref = { ref }
45- alt = { alt }
46- width = { width ? width : '100%' }
47- height = { height ? height : '100%' }
48- className = { clsx (
49- animationClasses ,
50- styles . Image ,
51- borderRadius && styles [ `Image--borderRadius-${ borderRadius } ` ] ,
52- className ,
53- ) }
54- srcSet = { srcSet }
55- style = { { ...animationInlineStyles , ...style } }
56- { ...rest }
57- />
58- </ span >
59- )
60- }
61- | || || || parent of 4e5264 d8 ( removed picture support from Image component )
62- export const Image = ( { animate, as = 'img' , borderRadius, className, style, media, ...rest } : ImageProps ) => {
63- if ( as === 'picture' ) {
64- // @ts -expect-error Incorrect typings from legacy code. Keeping as-is to avoid modifying API
65- const { sources, srcSet, ...imgRest } = rest
66-
67- return (
68- < NewImage animate = { animate } as = { as } borderRadius = { borderRadius } className = { clsx ( className ) } style = { style } >
69- { sources
70- ? sources . map ( ( source , index ) => < source key = { index } srcSet = { source . srcset } media = { source . media } /> )
71- : null }
72- { srcSet && < source srcSet = { srcSet } media = { media } /> }
73- { /* eslint-disable-next-line jsx-a11y/alt-text */ }
74- < img { ...imgRest } />
75- </ NewImage >
76- )
77- }
78- = === ===
7915export const Image = ( { alt, animate, borderRadius, className, style, ...props } : ImageProps ) => {
8016 const { classes : animationClasses , styles : animationInlineStyles } = useAnimation ( animate )
81- >>> > >>> 4e5264 d8 ( removed picture support from Image component )
8217
8318 return (
8419 < img
0 commit comments