@@ -62,7 +62,9 @@ export const CarouselImageItem = forwardRef<
6262 className = '' ,
6363 action,
6464 wasUserPress = false ,
65- ...rest
65+ [ 'aria-label' ] : ariaLabel ,
66+ style,
67+ onFocus,
6668 } ,
6769 ref ,
6870) {
@@ -71,10 +73,6 @@ export const CarouselImageItem = forwardRef<
7173 ( ) => mergeRefs < HTMLLIElement > ( itemRef , ref ) ,
7274 [ ref ] ,
7375 )
74- const isImageWithRichTextCaption = useMemo (
75- ( ) => type === 'imageWithRichTextBelow' && ! ! caption ,
76- [ caption , type ] ,
77- )
7876 const isJustImage =
7977 type === 'imageWithAltAndCaption' && ! caption && ! attribution
8078 const isImageWithSimpleCaption =
@@ -181,16 +179,18 @@ export const CarouselImageItem = forwardRef<
181179 />
182180 )
183181 }
184- if ( isImageWithRichTextCaption && image ) {
182+ if ( type === 'imageWithRichTextBelow' && image ) {
185183 return (
186184 < figure className = 'flex h-full w-full flex-col' >
187- < Image
188- grid = 'sm'
189- image = { image }
190- fill
191- className = { `min-h-single-carousel-card-h-sm w-full rounded-card md:min-h-single-carousel-card-h-md lg:min-h-single-carousel-card-h-lg` }
192- imageClassName = 'aspect-4/3 rounded-card md:aspect-video'
193- />
185+ < div className = 'relative aspect-video w-full shrink-0' >
186+ < Image
187+ grid = 'sm'
188+ image = { image }
189+ fill
190+ className = 'absolute inset-0'
191+ imageClassName = 'rounded-t-card object-cover'
192+ />
193+ </ div >
194194 < figcaption
195195 className = { twMerge (
196196 'h-fit max-w-text p-4 lg:px-8 lg:py-6' ,
@@ -237,15 +237,17 @@ export const CarouselImageItem = forwardRef<
237237
238238 return (
239239 < li
240- { ...rest }
241240 ref = { combinedItemRef }
241+ aria-label = { ariaLabel }
242242 { ...( displayMode === 'single' && {
243243 'aria-current' : active ,
244244 tabIndex : active ? 0 : - 1 ,
245245 } ) }
246246 { ...( displayMode === 'scroll' && {
247247 tabIndex : 0 ,
248248 } ) }
249+ style = { style }
250+ onFocus = { onFocus }
249251 className = { twMerge (
250252 `relative mt-1 focus:outline-hidden focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-grey-50 focus-visible:outline-offset-2 dark:focus-visible:outline-white-100` ,
251253 displayMode === 'single' &&
0 commit comments