refactor(carousel): implement composable carousel with embla#226
Open
SergioDep wants to merge 1 commit intomercurjs:mainfrom
Open
refactor(carousel): implement composable carousel with embla#226SergioDep wants to merge 1 commit intomercurjs:mainfrom
SergioDep wants to merge 1 commit intomercurjs:mainfrom
Conversation
Contributor
|
@SergioDep is attempting to deploy a commit to the Rigby Team Team on Vercel. A member of the Team first needs to authorize it. |
…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
cf747e6 to
b78c6b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎡 Refactor: Carousel Component - Embla Composable API Migration
Summary
Complete refactor of the Carousel component from a monolithic preset-based implementation to a flexible composable API built on Embla Carousel. This change provides better developer experience, more flexibility, and improved code maintainability.
🎯 Key Changes
New Composable Carousel Architecture
CustomCarouselwith modular composable componentsCarousel,CarouselContent,CarouselItemas base building blocksCarouselPrevious,CarouselNext,CarouselDots,CarouselProgress,CarouselThumbnailsuseCarousel()hook for custom indicator developmentCarouselApi,CarouselOptions,CarouselPlugin,ThumbnailData)Enhanced Features
embla-carousel-wheel-gesturesplugin for mouse wheel navigationembla-carousel-autoplayplugin for automatic slide transitionsComponent API
Removed Components
Indicatoratom component (replaced byCarouselProgressandCarouselDots)PresetCarouselreferences from examples📦 Dependencies
embla-carousel-autoplay@^8.6.0embla-carousel-wheel-gestures@^8.1.0🔄 Migration Impact
Updated Components (13 files)
ProductCarousel: Migrated to composable APIProductCarouselIndicator: Refactored to useuseCarousel()hookEmptyCart: Updated carousel implementationAlgoliaProductsCarousel: Optimized with proper memo and cleanupHomeProductsCarousel: Performance improvements with Map-based lookupsHomeCategories: Migrated with responsive basis classesHomePopularBrandsSection: Updated to composable APIImproved Code Quality
📚 Documentation
🎨 Storybook Setup
@storybook/nextjsframework🐛 Bug Fixes
ProductCarousel(removed duplicateobject-center)staticDirsconfiguration🚀 Performance
✅ Breaking Changes
CustomCarouselcomponent no longer available (useCarousel+ composable children)PresetCarouselremoved (examples updated to composable pattern)Indicatorcomponent removed (useCarouselProgressorCarouselDots)📝 Testing Notes
All carousel implementations across the app have been updated and tested. Storybook provides interactive examples for all supported patterns.