@@ -240,69 +240,91 @@ CarouselItem.displayName = 'CarouselItem';
240240const CarouselPrevious = React . forwardRef <
241241 HTMLButtonElement ,
242242 React . ComponentProps < typeof Button > & CarouselNavProps
243- > ( ( { className, variant = 'transparent' , size = 'icon' , customOnClick, ...props } , ref ) => {
244- const { orientation, scrollPrev, canScrollPrev } = useCarousel ( ) ;
243+ > (
244+ (
245+ {
246+ className,
247+ variant = 'transparent' ,
248+ size = 'icon' ,
249+ customOnClick,
250+ ...props
251+ } ,
252+ ref
253+ ) => {
254+ const { orientation, scrollPrev, canScrollPrev } = useCarousel ( ) ;
245255
246- const handleClick = ( ) => {
247- scrollPrev ( ) ;
248- if ( customOnClick ) customOnClick ( ) ;
249- } ;
256+ const handleClick = ( ) => {
257+ scrollPrev ( ) ;
258+ if ( customOnClick ) customOnClick ( ) ;
259+ } ;
250260
251- return (
252- < Button
253- ref = { ref }
254- variant = { variant }
255- size = { size }
256- className = { cn (
257- 'absolute' ,
258- orientation === 'horizontal'
259- ? '-left-12 top-1/2 -translate-y-1/2'
260- : '-top-12 left-1/2 -translate-x-1/2 rotate-90' ,
261- className
262- ) }
263- disabled = { ! canScrollPrev }
264- onClick = { handleClick }
265- { ...props }
266- >
267- < ChevronLeft className = "!h-full !w-full text-primary" />
268- < span className = "sr-only" > Previous slide</ span >
269- </ Button >
270- ) ;
271- } ) ;
261+ return (
262+ < Button
263+ ref = { ref }
264+ variant = { variant }
265+ size = { size }
266+ className = { cn (
267+ 'absolute' ,
268+ orientation === 'horizontal'
269+ ? '-left-12 top-1/2 -translate-y-1/2'
270+ : '-top-12 left-1/2 -translate-x-1/2 rotate-90' ,
271+ className
272+ ) }
273+ disabled = { ! canScrollPrev }
274+ onClick = { handleClick }
275+ { ...props }
276+ >
277+ < ChevronLeft className = "!h-full !w-full text-primary" />
278+ < span className = "sr-only" > Previous slide</ span >
279+ </ Button >
280+ ) ;
281+ }
282+ ) ;
272283CarouselPrevious . displayName = 'CarouselPrevious' ;
273284
274285const CarouselNext = React . forwardRef <
275286 HTMLButtonElement ,
276287 React . ComponentProps < typeof Button > & CarouselNavProps
277- > ( ( { className, variant = 'transparent' , size = 'icon' , customOnClick, ...props } , ref ) => {
278- const { orientation, scrollNext, canScrollNext } = useCarousel ( ) ;
288+ > (
289+ (
290+ {
291+ className,
292+ variant = 'transparent' ,
293+ size = 'icon' ,
294+ customOnClick,
295+ ...props
296+ } ,
297+ ref
298+ ) => {
299+ const { orientation, scrollNext, canScrollNext } = useCarousel ( ) ;
279300
280- const handleClick = ( ) => {
281- scrollNext ( ) ;
282- if ( customOnClick ) customOnClick ( ) ;
283- }
301+ const handleClick = ( ) => {
302+ scrollNext ( ) ;
303+ if ( customOnClick ) customOnClick ( ) ;
304+ } ;
284305
285- return (
286- < Button
287- ref = { ref }
288- variant = { variant }
289- size = { size }
290- className = { cn (
291- 'absolute' ,
292- orientation === 'horizontal'
293- ? '-right-12 top-1/2 -translate-y-1/2'
294- : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90' ,
295- className
296- ) }
297- disabled = { ! canScrollNext }
298- onClick = { handleClick }
299- { ...props }
300- >
301- < ChevronRight className = "!h-full !w-full text-primary" />
302- < span className = "sr-only" > Next slide</ span >
303- </ Button >
304- ) ;
305- } ) ;
306+ return (
307+ < Button
308+ ref = { ref }
309+ variant = { variant }
310+ size = { size }
311+ className = { cn (
312+ 'absolute' ,
313+ orientation === 'horizontal'
314+ ? '-right-12 top-1/2 -translate-y-1/2'
315+ : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90' ,
316+ className
317+ ) }
318+ disabled = { ! canScrollNext }
319+ onClick = { handleClick }
320+ { ...props }
321+ >
322+ < ChevronRight className = "!h-full !w-full text-primary" />
323+ < span className = "sr-only" > Next slide</ span >
324+ </ Button >
325+ ) ;
326+ }
327+ ) ;
306328CarouselNext . displayName = 'CarouselNext' ;
307329
308330const CarouselDots = React . forwardRef <
0 commit comments