Skip to content

Commit

Permalink
Update carousel component
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan-wajahat committed Jun 12, 2024
1 parent 5e140a0 commit 42580a3
Show file tree
Hide file tree
Showing 3 changed files with 3,018 additions and 2,340 deletions.
15 changes: 10 additions & 5 deletions app/components/ui/carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
'use client';

import * as React from 'react';
import useEmblaCarousel, {
type EmblaCarouselType as CarouselApi,
type EmblaOptionsType as CarouselOptions,
type EmblaPluginType as CarouselPlugin,
type UseEmblaCarouselType,
} from 'embla-carousel-react';
import { ArrowLeft, ArrowRight } from 'lucide-react';

import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';

type CarouselApi = UseEmblaCarouselType[1];
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
type CarouselOptions = UseCarouselParameters[0];
type CarouselPlugin = UseCarouselParameters[1];

type CarouselProps = {
opts?: CarouselOptions;
plugins?: CarouselPlugin[];
plugins?: CarouselPlugin;
orientation?: 'horizontal' | 'vertical';
setApi?: (api: CarouselApi) => void;
};
Expand Down Expand Up @@ -221,7 +226,7 @@ CarouselPrevious.displayName = 'CarouselPrevious';
const CarouselNext = React.forwardRef<
HTMLButtonElement,
React.ComponentProps<typeof Button>
>(({ className, variant = 'default', size = 'icon', ...props }, ref) => {
>(({ className, variant = 'outline', size = 'icon', ...props }, ref) => {
const { orientation, scrollNext, canScrollNext } = useCarousel();

return (
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"prettier-plugin-tailwindcss": "^0.6.2",
"tailwindcss": "3.4.3",
"typescript": "5.4.5"
}
}
},
"packageManager": "[email protected]+sha256.30a1801ac4e723779efed13a21f4c39f9eb6c9fbb4ced101bce06b422593d7c9"
}
Loading

0 comments on commit 42580a3

Please sign in to comment.