Skip to content

Commit b78c6b7

Browse files
committed
refactor(carousel): replace legacy carousel with composable Carousel API and migrate usages
- Introduce composable Carousel API (Carousel, CarouselContent, CarouselItem, navigation, dots, progress, thumbnails) and useCarousel hook - Implement keyboard, wheel gestures and plugin support; calculate scroll progress and expose CarouselApi types - Migrate components to new API: ProductCarousel, ProductCarouselIndicator, HomeProductsCarousel, HomeCategories, HomePopularBrandsSection, EmptyCart, AlgoliaProductsCarousel, and other call sites - Add comprehensive Storybook stories for Carousel (incl. autoplay, thumbnails, progress, custom indicators) - Remove legacy Indicator atom and update atoms/cells exports - Update Storybook config/preview, .gitignore entry, package.json scripts & deps, and regenerate yarn.lock
1 parent 065e50d commit b78c6b7

File tree

17 files changed

+1403
-715
lines changed

17 files changed

+1403
-715
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ yarn-error.log*
4040
# typescript
4141
*.tsbuildinfo
4242
next-env.d.ts
43+
44+
*storybook.log

.storybook/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
21
import type { StorybookConfig } from "@storybook/nextjs"
32

43
const config: StorybookConfig = {
@@ -13,6 +12,6 @@ const config: StorybookConfig = {
1312
name: "@storybook/nextjs",
1413
options: {},
1514
},
16-
staticDirs: ["..\\public"],
15+
staticDirs: ["../public"],
1716
}
1817
export default config

.storybook/preview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Preview } from "@storybook/react"
2+
import "../src/app/globals.css"
23

34
const preview: Preview = {
45
initialGlobals: {

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
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",
13+
"storybook": "storybook dev -p 6006",
14+
"build-storybook": "storybook build"
1015
},
1116
"dependencies": {
1217
"@headlessui/react": "^2.2.1",
@@ -20,13 +25,16 @@
2025
"algoliasearch": "^5.20.3",
2126
"clsx": "^2.1.1",
2227
"date-fns": "^4.1.0",
28+
"embla-carousel-autoplay": "^8.6.0",
2329
"embla-carousel-react": "^8.5.2",
30+
"embla-carousel-wheel-gestures": "^8.1.0",
2431
"i18next": "^25.2.1",
2532
"i18next-browser-languagedetector": "^8.1.0",
2633
"js-cookie": "^3.0.5",
2734
"lodash": "^4.17.21",
2835
"next": "15.1.4",
2936
"next-intl": "^3.26.3",
37+
"prettier": "^3.6.2",
3038
"react": "^19.0.0",
3139
"react-country-flag": "^3.1.0",
3240
"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)