@hua-labs/motion-core 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 HUA Labs Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,92 +1,86 @@
1
- # @hua-labs/motion-core
2
-
3
- Production-ready React animation hooks — zero dependencies, SSR-ready.
4
- 프로덕션 레디 React 애니메이션 훅 — 의존성 없음, SSR 지원.
5
-
6
- [![npm version](https://img.shields.io/npm/v/@hua-labs/motion-core.svg)](https://www.npmjs.com/package/@hua-labs/motion-core)
7
- [![npm downloads](https://img.shields.io/npm/dw/@hua-labs/motion-core.svg)](https://www.npmjs.com/package/@hua-labs/motion-core)
8
- [![license](https://img.shields.io/npm/l/@hua-labs/motion-core.svg)](https://github.com/HUA-Labs/HUA-Labs-public/blob/main/LICENSE)
9
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
10
- [![React](https://img.shields.io/badge/React-19-blue)](https://reactjs.org/)
11
-
12
- > **Alpha**: APIs may change before stable release. | **알파**: 안정 릴리스 전 API가 변경될 수 있습니다.
13
-
14
- ## Overview | 개요
15
-
16
- A collection of 25+ React animation hooks built on a ref-based engine. Direct DOM manipulation for consistent performance with zero external dependencies. All hooks are TypeScript-native and SSR-compatible.
17
-
18
- ref 기반 엔진으로 구축된 25개 이상의 React 애니메이션 훅 컬렉션입니다. 외부 의존성 없이 직접 DOM 조작으로 일관된 성능을 제공합니다. 모든 훅은 TypeScript 네이티브이며 SSR 호환됩니다.
19
-
20
- ## Features
21
-
22
- - **25+ animation hooks** — Fade, slide, scale, scroll, interactions, gestures
23
- - **Zero dependencies** — Pure JavaScript motion engine
24
- - **Ref-based** — Direct DOM manipulation for consistent performance
25
- - **SSR compatible** — Works with Next.js, Remix, and SSR frameworks
26
- - **Tested** — 517 test cases
27
-
28
- ## Installation | 설치
29
-
30
- ```bash
31
- pnpm add @hua-labs/motion-core
32
- ```
33
-
34
- Peer dependencies: `react >= 19.0.0`, `react-dom >= 19.0.0`
35
-
36
- ## Quick Start | 빠른 시작
37
-
38
- ```tsx
39
- import { useFadeIn, useSlideUp } from '@hua-labs/motion-core';
40
-
41
- function Hero() {
42
- const fadeIn = useFadeIn({ duration: 800 });
43
- const slideUp = useSlideUp({ delay: 200 });
44
-
45
- return (
46
- <div>
47
- <h1 ref={fadeIn.ref} style={fadeIn.style}>Welcome</h1>
48
- <p ref={slideUp.ref} style={slideUp.style}>Animated content</p>
49
- </div>
50
- );
51
- }
52
- ```
53
-
54
- ## API Overview | API 개요
55
-
56
- All hooks return a consistent `BaseMotionReturn` interface:
57
-
58
- | Property | Type | Description |
59
- |----------|------|-------------|
60
- | `ref` | `RefObject<T>` | Attach to target element |
61
- | `style` | `CSSProperties` | Apply to element |
62
- | `isVisible` | `boolean` | Visibility state |
63
- | `isAnimating` | `boolean` | Animation in progress |
64
- | `start/stop/reset/pause/resume` | `() => void` | Playback controls |
65
-
66
- **Available hooks by category:**
67
-
68
- | Category | Hooks |
69
- |----------|-------|
70
- | Basic | `useFadeIn`, `useSlideUp`, `useSlideLeft`, `useSlideRight`, `useScaleIn`, `useBounceIn`, `usePulse`, `useSpringMotion`, `useGradient` |
71
- | Interaction | `useHoverMotion`, `useClickToggle`, `useFocusToggle`, `useToggleMotion` |
72
- | Scroll | `useScrollReveal`, `useScrollProgress` |
73
- | List | `useStaggerMotion`, `useCardList`, `useSkeleton` |
74
- | Utility | `useMotionState`, `useRepeat`, `useSmartMotion`, `useUnifiedMotion`, `useSimplePageMotion`, `usePageMotions`, `useGesture`, `useGestureMotion` |
75
-
76
- ## Documentation | 문서
77
-
78
- - [Detailed Guide](./DETAILED_GUIDE.md)
79
- - [📚 Documentation Site | 문서 사이트](https://docs.hua-labs.com)
80
-
81
- ## Related Packages | 관련 패키지
82
-
83
- - [`@hua-labs/pro`](https://www.npmjs.com/package/@hua-labs/pro) — Advanced motion hooks (orchestration, auto-animations)
84
- - [`@hua-labs/hua-ux`](https://www.npmjs.com/package/@hua-labs/hua-ux) — UX framework (includes motion)
85
-
86
- ## Requirements | 요구사항
87
-
88
- React >= 19.0.0 · React DOM >= 19.0.0 · TypeScript >= 5.9
89
-
90
- ## License
91
-
92
- MIT — [HUA Labs](https://github.com/HUA-Labs/HUA-Labs-public)
1
+ # @hua-labs/motion-core
2
+
3
+ Production-ready React animation hooks — zero dependencies, SSR-ready.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@hua-labs/motion-core.svg)](https://www.npmjs.com/package/@hua-labs/motion-core)
6
+ [![npm downloads](https://img.shields.io/npm/dw/@hua-labs/motion-core.svg)](https://www.npmjs.com/package/@hua-labs/motion-core)
7
+ [![license](https://img.shields.io/npm/l/@hua-labs/motion-core.svg)](https://github.com/HUA-Labs/HUA-Labs-public/blob/main/LICENSE)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
9
+ [![React](https://img.shields.io/badge/React-19-blue)](https://reactjs.org/)
10
+
11
+ ## Overview
12
+
13
+ A collection of 25+ React animation hooks built on a ref-based engine. Direct DOM manipulation for consistent performance with zero external dependencies. All hooks are TypeScript-native and SSR-compatible.
14
+
15
+ ## Features
16
+
17
+ - **25+ animation hooks** — Fade, slide, scale, scroll, interactions, gestures
18
+ - **Zero dependencies** Pure JavaScript motion engine
19
+ - **Ref-based** — Direct DOM manipulation for consistent performance
20
+ - **SSR compatible** — Works with Next.js, Remix, and SSR frameworks
21
+ - **Tested** — 517 test cases
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ pnpm add @hua-labs/motion-core
27
+ ```
28
+
29
+ Peer dependencies: `react >= 19.0.0`, `react-dom >= 19.0.0`
30
+
31
+ ## Quick Start
32
+
33
+ ```tsx
34
+ import { useFadeIn, useSlideUp } from '@hua-labs/motion-core';
35
+
36
+ function Hero() {
37
+ const fadeIn = useFadeIn({ duration: 800 });
38
+ const slideUp = useSlideUp({ delay: 200 });
39
+
40
+ return (
41
+ <div>
42
+ <h1 ref={fadeIn.ref} style={fadeIn.style}>Welcome</h1>
43
+ <p ref={slideUp.ref} style={slideUp.style}>Animated content</p>
44
+ </div>
45
+ );
46
+ }
47
+ ```
48
+
49
+ ## API Overview
50
+
51
+ All hooks return a consistent `BaseMotionReturn` interface:
52
+
53
+ | Property | Type | Description |
54
+ |----------|------|-------------|
55
+ | `ref` | `RefObject<T>` | Attach to target element |
56
+ | `style` | `CSSProperties` | Apply to element |
57
+ | `isVisible` | `boolean` | Visibility state |
58
+ | `isAnimating` | `boolean` | Animation in progress |
59
+ | `start/stop/reset/pause/resume` | `() => void` | Playback controls |
60
+
61
+ **Available hooks by category:**
62
+
63
+ | Category | Hooks |
64
+ |----------|-------|
65
+ | Basic | `useFadeIn`, `useSlideUp`, `useSlideLeft`, `useSlideRight`, `useScaleIn`, `useBounceIn`, `usePulse`, `useSpringMotion`, `useGradient` |
66
+ | Interaction | `useHoverMotion`, `useClickToggle`, `useFocusToggle`, `useToggleMotion` |
67
+ | Scroll | `useScrollReveal`, `useScrollProgress` |
68
+ | List | `useStaggerMotion`, `useCardList`, `useSkeleton` |
69
+ | Utility | `useMotionState`, `useRepeat`, `useSmartMotion`, `useUnifiedMotion`, `useSimplePageMotion`, `usePageMotions`, `useGesture`, `useGestureMotion` |
70
+
71
+ ## Documentation
72
+
73
+ - [Detailed Guide](./DETAILED_GUIDE.md)
74
+ - [Documentation Site](https://docs.hua-labs.com)
75
+
76
+ ## Related Packages
77
+
78
+ - [`@hua-labs/hua`](https://www.npmjs.com/package/@hua-labs/hua) — UX framework (includes motion)
79
+
80
+ ## Requirements
81
+
82
+ React >= 19.0.0 · React DOM >= 19.0.0 · TypeScript >= 5.9
83
+
84
+ ## License
85
+
86
+ MIT [HUA Labs](https://github.com/HUA-Labs/HUA-Labs-public)
package/dist/index.d.mts CHANGED
@@ -680,7 +680,7 @@ declare function useSmartMotion<T extends HTMLElement = HTMLDivElement>(options?
680
680
  interface UseUnifiedMotionOptions extends Omit<BaseMotionOptions, 'autoStart'> {
681
681
  /** Motion type to use */
682
682
  type: EntranceType;
683
- /** Auto start animation @default false */
683
+ /** Auto start animation @default true */
684
684
  autoStart?: boolean;
685
685
  /** Slide distance (px) for slide types @default 50 */
686
686
  distance?: number;
package/dist/index.d.ts CHANGED
@@ -680,7 +680,7 @@ declare function useSmartMotion<T extends HTMLElement = HTMLDivElement>(options?
680
680
  interface UseUnifiedMotionOptions extends Omit<BaseMotionOptions, 'autoStart'> {
681
681
  /** Motion type to use */
682
682
  type: EntranceType;
683
- /** Auto start animation @default false */
683
+ /** Auto start animation @default true */
684
684
  autoStart?: boolean;
685
685
  /** Slide distance (px) for slide types @default 50 */
686
686
  distance?: number;
package/dist/index.js CHANGED
@@ -1664,7 +1664,7 @@ function useUnifiedMotion(options) {
1664
1664
  const {
1665
1665
  type,
1666
1666
  duration = 600,
1667
- autoStart = false,
1667
+ autoStart = true,
1668
1668
  delay = 0,
1669
1669
  easing: easing2,
1670
1670
  threshold = 0.1,