From 197ee3289dd6783d3e41bcbc8a2f1b8a62a4da1c Mon Sep 17 00:00:00 2001 From: Saagar Takhi Date: Fri, 28 Jul 2023 20:35:53 +0200 Subject: [PATCH] feat: expose types and restructure index --- .../Parallax/{index.tsx => Parallax.tsx} | 0 src/components/Parallax/index.ts | 2 ++ .../{index.tsx => ParallaxBanner.tsx} | 0 src/components/ParallaxBanner/index.ts | 3 +++ .../{index.tsx => ParallaxProvider.tsx} | 0 src/components/ParallaxProvider/index.ts | 2 ++ src/hooks/index.ts | 2 ++ src/index.ts | 27 +++++-------------- 8 files changed, 15 insertions(+), 21 deletions(-) rename src/components/Parallax/{index.tsx => Parallax.tsx} (100%) create mode 100644 src/components/Parallax/index.ts rename src/components/ParallaxBanner/{index.tsx => ParallaxBanner.tsx} (100%) create mode 100644 src/components/ParallaxBanner/index.ts rename src/components/ParallaxProvider/{index.tsx => ParallaxProvider.tsx} (100%) create mode 100644 src/components/ParallaxProvider/index.ts create mode 100644 src/hooks/index.ts diff --git a/src/components/Parallax/index.tsx b/src/components/Parallax/Parallax.tsx similarity index 100% rename from src/components/Parallax/index.tsx rename to src/components/Parallax/Parallax.tsx diff --git a/src/components/Parallax/index.ts b/src/components/Parallax/index.ts new file mode 100644 index 000000000..93ac10adc --- /dev/null +++ b/src/components/Parallax/index.ts @@ -0,0 +1,2 @@ +export { Parallax } from './Parallax'; +export * from './types'; diff --git a/src/components/ParallaxBanner/index.tsx b/src/components/ParallaxBanner/ParallaxBanner.tsx similarity index 100% rename from src/components/ParallaxBanner/index.tsx rename to src/components/ParallaxBanner/ParallaxBanner.tsx diff --git a/src/components/ParallaxBanner/index.ts b/src/components/ParallaxBanner/index.ts new file mode 100644 index 000000000..242eeac11 --- /dev/null +++ b/src/components/ParallaxBanner/index.ts @@ -0,0 +1,3 @@ +export { ParallaxBanner } from './ParallaxBanner'; +export { ParallaxBannerLayer } from './components/ParallaxBannerLayer'; +export * from './types'; diff --git a/src/components/ParallaxProvider/index.tsx b/src/components/ParallaxProvider/ParallaxProvider.tsx similarity index 100% rename from src/components/ParallaxProvider/index.tsx rename to src/components/ParallaxProvider/ParallaxProvider.tsx diff --git a/src/components/ParallaxProvider/index.ts b/src/components/ParallaxProvider/index.ts new file mode 100644 index 000000000..c4188f803 --- /dev/null +++ b/src/components/ParallaxProvider/index.ts @@ -0,0 +1,2 @@ +export { ParallaxProvider } from './ParallaxProvider'; +export * from './types'; diff --git a/src/hooks/index.ts b/src/hooks/index.ts new file mode 100644 index 000000000..fbd4a4017 --- /dev/null +++ b/src/hooks/index.ts @@ -0,0 +1,2 @@ +export { useParallax } from './useParallax'; +export { useParallaxController } from './useParallaxController'; diff --git a/src/index.ts b/src/index.ts index 94e784d95..25172a499 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,22 +1,7 @@ -import { EasingPreset, EffectNumber, EffectString } from 'parallax-controller'; +export { EasingPreset, EffectNumber, EffectString } from 'parallax-controller'; -import { Parallax } from './components/Parallax'; -import { ParallaxBanner } from './components/ParallaxBanner'; -import { ParallaxBannerLayer } from './components/ParallaxBanner/components/ParallaxBannerLayer'; -import { ParallaxProvider } from './components/ParallaxProvider'; -import { ParallaxContext } from './context/ParallaxContext'; -import { useParallax } from './hooks/useParallax'; -import { useParallaxController } from './hooks/useParallaxController'; - -export { - useParallax, - useParallaxController, - Parallax, - ParallaxBanner, - ParallaxBannerLayer, - ParallaxProvider, - ParallaxContext, - EasingPreset, - EffectNumber, - EffectString, -}; +export * from './components/Parallax'; +export * from './components/ParallaxBanner'; +export * from './components/ParallaxProvider'; +export * from './hooks'; +export { ParallaxContext } from './context/ParallaxContext';