import { jsx } from 'react/jsx-runtime';
import React__default from 'react';
import { ChevronLeftIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
import { cn } from '../../../utils/cn.js';
import { useCarouselContext } from './CarouselContext.js';
import { carouselTheme } from './Carousel.theme.js';

const CarouselPrevious = React__default.forwardRef(({ className, icon, 'aria-label': ariaLabel, ...props }, ref) => {
    const { scrollPrev, canScrollPrev, orientation } = useCarouselContext();
    return (jsx("button", { ref: ref, type: "button", onClick: scrollPrev, disabled: !canScrollPrev, "aria-label": ariaLabel || 'Previous slide', className: cn(carouselTheme.button, className), ...props, children: icon ||
            (orientation === 'horizontal' ? (jsx(ChevronLeftIcon, { className: carouselTheme.buttonIcon, "aria-hidden": "true" })) : (jsx(ChevronUpIcon, { className: carouselTheme.buttonIcon, "aria-hidden": "true" }))) }));
});
CarouselPrevious.displayName = 'Carousel.Previous';

export { CarouselPrevious };
