Skip to content

Commit cf747e6

Browse files
committed
refactor(carousel): implement composable carousel with embla
- Replace CustomCarousel with new composable Carousel component - Add wheel gesture support via embla-carousel-wheel-gestures - Implement multiple indicator patterns (dots, progress, thumbnails) - Remove deprecated Indicator atom component - Update ProductCarousel and home sections to new API - Add keyboard navigation and improved accessibility - Include Spanish ARIA labels and screen reader support - Add prettier and linting scripts to package.json Key improvements: - Composable API with CarouselContent, CarouselItem, CarouselPrevious, CarouselNext - useCarousel hook for custom extensions - Built-in progress tracking and scroll management - Better focus management and keyboard navigation - Fully customizable indicator components
1 parent 065e50d commit cf747e6

File tree

14 files changed

+1382
-713
lines changed

14 files changed

+1382
-713
lines changed

.storybook/examples/CarouselDemoClient.tsx.example

Lines changed: 501 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"dev": "next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"lint:fix": "next lint --fix",
11+
"format": "prettier --write .",
12+
"type-check": "tsc --noEmit"
1013
},
1114
"dependencies": {
1215
"@headlessui/react": "^2.2.1",
@@ -21,12 +24,14 @@
2124
"clsx": "^2.1.1",
2225
"date-fns": "^4.1.0",
2326
"embla-carousel-react": "^8.5.2",
27+
"embla-carousel-wheel-gestures": "^8.1.0",
2428
"i18next": "^25.2.1",
2529
"i18next-browser-languagedetector": "^8.1.0",
2630
"js-cookie": "^3.0.5",
2731
"lodash": "^4.17.21",
2832
"next": "15.1.4",
2933
"next-intl": "^3.26.3",
34+
"prettier": "^3.6.2",
3035
"react": "^19.0.0",
3136
"react-country-flag": "^3.1.0",
3237
"react-dom": "^19.0.0",

src/components/atoms/Indicator/Indicator.tsx

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/components/atoms/index.ts

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
1-
import { Button } from "./Button/Button"
2-
import { IconButton } from "./IconButton/IconButton"
3-
import { Avatar } from "./Avatar/Avatar"
4-
import { Badge } from "./Badge/Badge"
5-
import { Breadcrumbs } from "./Breadcrumbs/Breadcrumbs"
6-
import { Checkbox } from "./Checkbox/Checkbox"
7-
import { Chip } from "./Chip/Chip"
8-
import { Divider } from "./Divider/Divider"
9-
import { Indicator } from "./Indicator/Indicator"
10-
import { Input } from "./Input/Input"
11-
import { Textarea } from "./Textarea/Textarea"
12-
import { PaginationButton } from "./PaginationButton/PaginationButton"
13-
import { Card } from "./Card/Card"
14-
import { StarRating } from "./StarRating/StarRating"
15-
import { InteractiveStarRating } from "./InteractiveStarRating/InteractiveStarRating"
16-
import { Label } from "./Label/Label"
17-
import { TabsTrigger } from "./TabsTrigger/TabsTrigger"
18-
import { NavigationItem } from "./NavigationItem/NavigationItem"
19-
import { LogoutButton } from "./LogoutButton/LogoutButton"
20-
21-
export {
22-
Button,
23-
IconButton,
24-
Avatar,
25-
Badge,
26-
Breadcrumbs,
27-
Checkbox,
28-
Chip,
29-
Divider,
30-
Indicator,
31-
Input,
32-
Textarea,
33-
PaginationButton,
34-
Card,
35-
StarRating,
36-
InteractiveStarRating,
37-
Label,
38-
TabsTrigger,
39-
NavigationItem,
40-
LogoutButton,
41-
}
1+
export { Button } from "./Button/Button"
2+
export { IconButton } from "./IconButton/IconButton"
3+
export { Avatar } from "./Avatar/Avatar"
4+
export { Badge } from "./Badge/Badge"
5+
export { Breadcrumbs } from "./Breadcrumbs/Breadcrumbs"
6+
export { Checkbox } from "./Checkbox/Checkbox"
7+
export { Chip } from "./Chip/Chip"
8+
export { Divider } from "./Divider/Divider"
9+
export { Input } from "./Input/Input"
10+
export { Textarea } from "./Textarea/Textarea"
11+
export { PaginationButton } from "./PaginationButton/PaginationButton"
12+
export { Card } from "./Card/Card"
13+
export { StarRating } from "./StarRating/StarRating"
14+
export { InteractiveStarRating } from "./InteractiveStarRating/InteractiveStarRating"
15+
export { Label } from "./Label/Label"
16+
export { TabsTrigger } from "./TabsTrigger/TabsTrigger"
17+
export { NavigationItem } from "./NavigationItem/NavigationItem"
18+
export { LogoutButton } from "./LogoutButton/LogoutButton"

0 commit comments

Comments
 (0)