@hua-labs/motion-core 2.1.0-alpha.9 → 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/README.md +9 -15
- package/dist/index.d.mts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @hua-labs/motion-core
|
|
2
2
|
|
|
3
3
|
Production-ready React animation hooks — zero dependencies, SSR-ready.
|
|
4
|
-
프로덕션 레디 React 애니메이션 훅 — 의존성 없음, SSR 지원.
|
|
5
4
|
|
|
6
5
|
[](https://www.npmjs.com/package/@hua-labs/motion-core)
|
|
7
6
|
[](https://www.npmjs.com/package/@hua-labs/motion-core)
|
|
@@ -9,14 +8,10 @@ Production-ready React animation hooks — zero dependencies, SSR-ready.
|
|
|
9
8
|
[](https://www.typescriptlang.org/)
|
|
10
9
|
[](https://reactjs.org/)
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## Overview | 개요
|
|
11
|
+
## Overview
|
|
15
12
|
|
|
16
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.
|
|
17
14
|
|
|
18
|
-
ref 기반 엔진으로 구축된 25개 이상의 React 애니메이션 훅 컬렉션입니다. 외부 의존성 없이 직접 DOM 조작으로 일관된 성능을 제공합니다. 모든 훅은 TypeScript 네이티브이며 SSR 호환됩니다.
|
|
19
|
-
|
|
20
15
|
## Features
|
|
21
16
|
|
|
22
17
|
- **25+ animation hooks** — Fade, slide, scale, scroll, interactions, gestures
|
|
@@ -25,7 +20,7 @@ ref 기반 엔진으로 구축된 25개 이상의 React 애니메이션 훅 컬
|
|
|
25
20
|
- **SSR compatible** — Works with Next.js, Remix, and SSR frameworks
|
|
26
21
|
- **Tested** — 517 test cases
|
|
27
22
|
|
|
28
|
-
## Installation
|
|
23
|
+
## Installation
|
|
29
24
|
|
|
30
25
|
```bash
|
|
31
26
|
pnpm add @hua-labs/motion-core
|
|
@@ -33,7 +28,7 @@ pnpm add @hua-labs/motion-core
|
|
|
33
28
|
|
|
34
29
|
Peer dependencies: `react >= 19.0.0`, `react-dom >= 19.0.0`
|
|
35
30
|
|
|
36
|
-
## Quick Start
|
|
31
|
+
## Quick Start
|
|
37
32
|
|
|
38
33
|
```tsx
|
|
39
34
|
import { useFadeIn, useSlideUp } from '@hua-labs/motion-core';
|
|
@@ -51,7 +46,7 @@ function Hero() {
|
|
|
51
46
|
}
|
|
52
47
|
```
|
|
53
48
|
|
|
54
|
-
## API Overview
|
|
49
|
+
## API Overview
|
|
55
50
|
|
|
56
51
|
All hooks return a consistent `BaseMotionReturn` interface:
|
|
57
52
|
|
|
@@ -73,17 +68,16 @@ All hooks return a consistent `BaseMotionReturn` interface:
|
|
|
73
68
|
| List | `useStaggerMotion`, `useCardList`, `useSkeleton` |
|
|
74
69
|
| Utility | `useMotionState`, `useRepeat`, `useSmartMotion`, `useUnifiedMotion`, `useSimplePageMotion`, `usePageMotions`, `useGesture`, `useGestureMotion` |
|
|
75
70
|
|
|
76
|
-
## Documentation
|
|
71
|
+
## Documentation
|
|
77
72
|
|
|
78
73
|
- [Detailed Guide](./DETAILED_GUIDE.md)
|
|
79
|
-
- [
|
|
74
|
+
- [Documentation Site](https://docs.hua-labs.com)
|
|
80
75
|
|
|
81
|
-
## Related Packages
|
|
76
|
+
## Related Packages
|
|
82
77
|
|
|
83
|
-
- [`@hua-labs/
|
|
84
|
-
- [`@hua-labs/hua-ux`](https://www.npmjs.com/package/@hua-labs/hua-ux) — UX framework (includes motion)
|
|
78
|
+
- [`@hua-labs/hua`](https://www.npmjs.com/package/@hua-labs/hua) — UX framework (includes motion)
|
|
85
79
|
|
|
86
|
-
## Requirements
|
|
80
|
+
## Requirements
|
|
87
81
|
|
|
88
82
|
React >= 19.0.0 · React DOM >= 19.0.0 · TypeScript >= 5.9
|
|
89
83
|
|
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
|
|
683
|
+
/** Auto start animation @default true */
|
|
684
684
|
autoStart?: boolean;
|
|
685
685
|
/** Slide distance (px) for slide types @default 50 */
|
|
686
686
|
distance?: number;
|
|
@@ -828,8 +828,6 @@ type MotionState = 'idle' | 'playing' | 'paused' | 'completed' | 'error';
|
|
|
828
828
|
type MotionDirection = 'forward' | 'reverse' | 'alternate';
|
|
829
829
|
interface MotionStateOptions {
|
|
830
830
|
initialState?: MotionState;
|
|
831
|
-
/** @deprecated Use autoStart instead */
|
|
832
|
-
autoPlay?: boolean;
|
|
833
831
|
autoStart?: boolean;
|
|
834
832
|
loop?: boolean;
|
|
835
833
|
direction?: MotionDirection;
|
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
|
|
683
|
+
/** Auto start animation @default true */
|
|
684
684
|
autoStart?: boolean;
|
|
685
685
|
/** Slide distance (px) for slide types @default 50 */
|
|
686
686
|
distance?: number;
|
|
@@ -828,8 +828,6 @@ type MotionState = 'idle' | 'playing' | 'paused' | 'completed' | 'error';
|
|
|
828
828
|
type MotionDirection = 'forward' | 'reverse' | 'alternate';
|
|
829
829
|
interface MotionStateOptions {
|
|
830
830
|
initialState?: MotionState;
|
|
831
|
-
/** @deprecated Use autoStart instead */
|
|
832
|
-
autoPlay?: boolean;
|
|
833
831
|
autoStart?: boolean;
|
|
834
832
|
loop?: boolean;
|
|
835
833
|
direction?: MotionDirection;
|
package/dist/index.js
CHANGED
|
@@ -1664,7 +1664,7 @@ function useUnifiedMotion(options) {
|
|
|
1664
1664
|
const {
|
|
1665
1665
|
type,
|
|
1666
1666
|
duration = 600,
|
|
1667
|
-
autoStart =
|
|
1667
|
+
autoStart = true,
|
|
1668
1668
|
delay = 0,
|
|
1669
1669
|
easing: easing2,
|
|
1670
1670
|
threshold = 0.1,
|
|
@@ -3238,8 +3238,7 @@ function useScrollProgress(options = {}) {
|
|
|
3238
3238
|
function useMotionState(options = {}) {
|
|
3239
3239
|
const {
|
|
3240
3240
|
initialState = "idle",
|
|
3241
|
-
|
|
3242
|
-
autoStart = autoPlay ?? false,
|
|
3241
|
+
autoStart = false,
|
|
3243
3242
|
loop = false,
|
|
3244
3243
|
direction = "forward",
|
|
3245
3244
|
duration = 1e3,
|