@hua-labs/motion-core 2.2.3 → 2.3.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/dist/index.d.mts +387 -126
- package/dist/index.mjs +2057 -963
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/index.d.ts +0 -1366
- package/dist/index.js +0 -4756
- package/dist/index.js.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -134,6 +134,10 @@ declare class TransitionEffects {
|
|
|
134
134
|
private static instance;
|
|
135
135
|
private activeTransitions;
|
|
136
136
|
static getInstance(): TransitionEffects;
|
|
137
|
+
/**
|
|
138
|
+
* 공통 전환 실행 헬퍼
|
|
139
|
+
*/
|
|
140
|
+
private executeTransition;
|
|
137
141
|
/**
|
|
138
142
|
* 페이드 인/아웃 전환
|
|
139
143
|
*/
|
|
@@ -189,130 +193,6 @@ declare class TransitionEffects {
|
|
|
189
193
|
}
|
|
190
194
|
declare const transitionEffects: TransitionEffects;
|
|
191
195
|
|
|
192
|
-
/**
|
|
193
|
-
* HUA Motion Core - 성능 최적화 시스템
|
|
194
|
-
*
|
|
195
|
-
* GPU 가속, 레이어 관리, 메모리 최적화를 위한 유틸리티들
|
|
196
|
-
* 브라우저별 최적화 전략 포함
|
|
197
|
-
*/
|
|
198
|
-
interface PerformanceOptimizerMetrics {
|
|
199
|
-
fps: number;
|
|
200
|
-
memoryUsage?: number;
|
|
201
|
-
gpuTime?: number;
|
|
202
|
-
cpuTime?: number;
|
|
203
|
-
layerCount: number;
|
|
204
|
-
activeMotions: number;
|
|
205
|
-
}
|
|
206
|
-
interface OptimizationConfig {
|
|
207
|
-
enableGPUAcceleration: boolean;
|
|
208
|
-
enableLayerSeparation: boolean;
|
|
209
|
-
enableMemoryOptimization: boolean;
|
|
210
|
-
targetFPS: number;
|
|
211
|
-
maxLayerCount: number;
|
|
212
|
-
memoryThreshold: number;
|
|
213
|
-
}
|
|
214
|
-
declare class PerformanceOptimizer {
|
|
215
|
-
private static instance;
|
|
216
|
-
private config;
|
|
217
|
-
private performanceObserver;
|
|
218
|
-
private metrics;
|
|
219
|
-
private layerRegistry;
|
|
220
|
-
private isMonitoring;
|
|
221
|
-
constructor();
|
|
222
|
-
static getInstance(): PerformanceOptimizer;
|
|
223
|
-
/**
|
|
224
|
-
* 성능 모니터링 초기화
|
|
225
|
-
*/
|
|
226
|
-
private initializePerformanceMonitoring;
|
|
227
|
-
/**
|
|
228
|
-
* 성능 메트릭 업데이트
|
|
229
|
-
*/
|
|
230
|
-
private updatePerformanceMetrics;
|
|
231
|
-
/**
|
|
232
|
-
* FPS 계산
|
|
233
|
-
*/
|
|
234
|
-
private calculateFPS;
|
|
235
|
-
/**
|
|
236
|
-
* GPU 가속 활성화
|
|
237
|
-
*/
|
|
238
|
-
enableGPUAcceleration(element: HTMLElement): void;
|
|
239
|
-
/**
|
|
240
|
-
* 레이어 분리 및 최적화
|
|
241
|
-
*/
|
|
242
|
-
createOptimizedLayer(element: HTMLElement): void;
|
|
243
|
-
/**
|
|
244
|
-
* 레이어 등록
|
|
245
|
-
*/
|
|
246
|
-
private registerLayer;
|
|
247
|
-
/**
|
|
248
|
-
* 레이어 제거
|
|
249
|
-
*/
|
|
250
|
-
removeLayer(element: HTMLElement): void;
|
|
251
|
-
/**
|
|
252
|
-
* 레이어 수 제한 체크
|
|
253
|
-
*/
|
|
254
|
-
private checkLayerLimit;
|
|
255
|
-
/**
|
|
256
|
-
* 오래된 레이어 정리
|
|
257
|
-
*/
|
|
258
|
-
private cleanupOldLayers;
|
|
259
|
-
/**
|
|
260
|
-
* 메모리 사용량 체크
|
|
261
|
-
*/
|
|
262
|
-
private checkMemoryUsage;
|
|
263
|
-
/**
|
|
264
|
-
* 메모리 정리
|
|
265
|
-
*/
|
|
266
|
-
private cleanupMemory;
|
|
267
|
-
/**
|
|
268
|
-
* 성능 최적화 설정 업데이트
|
|
269
|
-
*/
|
|
270
|
-
updateConfig(newConfig: Partial<OptimizationConfig>): void;
|
|
271
|
-
/**
|
|
272
|
-
* 모든 GPU 가속 비활성화
|
|
273
|
-
*/
|
|
274
|
-
private disableAllGPUAcceleration;
|
|
275
|
-
/**
|
|
276
|
-
* 모든 레이어 비활성화
|
|
277
|
-
*/
|
|
278
|
-
private disableAllLayers;
|
|
279
|
-
/**
|
|
280
|
-
* 성능 메트릭 가져오기
|
|
281
|
-
*/
|
|
282
|
-
getMetrics(): PerformanceOptimizerMetrics;
|
|
283
|
-
/**
|
|
284
|
-
* 성능 모니터링 시작
|
|
285
|
-
*/
|
|
286
|
-
startMonitoring(): void;
|
|
287
|
-
/**
|
|
288
|
-
* 성능 모니터링 중지
|
|
289
|
-
*/
|
|
290
|
-
stopMonitoring(): void;
|
|
291
|
-
/**
|
|
292
|
-
* 메트릭 업데이트
|
|
293
|
-
*/
|
|
294
|
-
private updateMetrics;
|
|
295
|
-
/**
|
|
296
|
-
* 성능 리포트 생성
|
|
297
|
-
*/
|
|
298
|
-
generateReport(): string;
|
|
299
|
-
/**
|
|
300
|
-
* 바이트 단위 포맷팅
|
|
301
|
-
*/
|
|
302
|
-
private formatBytes;
|
|
303
|
-
/**
|
|
304
|
-
* 성능 최적화 권장사항
|
|
305
|
-
*/
|
|
306
|
-
getOptimizationRecommendations(): string[];
|
|
307
|
-
/**
|
|
308
|
-
* 정리
|
|
309
|
-
*/
|
|
310
|
-
destroy(): void;
|
|
311
|
-
private lastFrameTime?;
|
|
312
|
-
private monitoringInterval?;
|
|
313
|
-
}
|
|
314
|
-
declare const performanceOptimizer: PerformanceOptimizer;
|
|
315
|
-
|
|
316
196
|
type MotionElement = HTMLDivElement | HTMLSpanElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLImageElement;
|
|
317
197
|
type MotionStyle = CSSProperties & {
|
|
318
198
|
'--motion-delay'?: string;
|
|
@@ -589,7 +469,7 @@ interface MotionPreset {
|
|
|
589
469
|
interface PresetConfig {
|
|
590
470
|
[key: string]: MotionPreset;
|
|
591
471
|
}
|
|
592
|
-
interface SpringConfig {
|
|
472
|
+
interface SpringConfig$1 {
|
|
593
473
|
mass?: number;
|
|
594
474
|
stiffness?: number;
|
|
595
475
|
damping?: number;
|
|
@@ -1061,6 +941,193 @@ declare function useGestureMotion(options: GestureMotionOptions): {
|
|
|
1061
941
|
isActive: boolean;
|
|
1062
942
|
};
|
|
1063
943
|
|
|
944
|
+
interface ButtonEffectOptions extends BaseMotionOptions {
|
|
945
|
+
type?: 'scale' | 'ripple' | 'glow' | 'shake' | 'bounce' | 'slide' | 'custom';
|
|
946
|
+
scaleAmount?: number;
|
|
947
|
+
rippleColor?: string;
|
|
948
|
+
rippleSize?: number;
|
|
949
|
+
rippleDuration?: number;
|
|
950
|
+
glowColor?: string;
|
|
951
|
+
glowSize?: number;
|
|
952
|
+
glowIntensity?: number;
|
|
953
|
+
shakeAmount?: number;
|
|
954
|
+
shakeFrequency?: number;
|
|
955
|
+
bounceHeight?: number;
|
|
956
|
+
bounceStiffness?: number;
|
|
957
|
+
slideDistance?: number;
|
|
958
|
+
slideDirection?: 'left' | 'right' | 'up' | 'down';
|
|
959
|
+
hoverScale?: number;
|
|
960
|
+
hoverRotate?: number;
|
|
961
|
+
hoverTranslateY?: number;
|
|
962
|
+
hoverTranslateX?: number;
|
|
963
|
+
activeScale?: number;
|
|
964
|
+
activeRotate?: number;
|
|
965
|
+
activeTranslateY?: number;
|
|
966
|
+
activeTranslateX?: number;
|
|
967
|
+
focusScale?: number;
|
|
968
|
+
focusGlow?: boolean;
|
|
969
|
+
disabled?: boolean;
|
|
970
|
+
disabledOpacity?: number;
|
|
971
|
+
autoStart?: boolean;
|
|
972
|
+
}
|
|
973
|
+
declare function useButtonEffect<T extends MotionElement = HTMLButtonElement>(options?: ButtonEffectOptions): BaseMotionReturn<T> & {
|
|
974
|
+
buttonType: string;
|
|
975
|
+
isPressed: boolean;
|
|
976
|
+
isHovered: boolean;
|
|
977
|
+
isFocused: boolean;
|
|
978
|
+
ripplePosition: {
|
|
979
|
+
x: number;
|
|
980
|
+
y: number;
|
|
981
|
+
};
|
|
982
|
+
currentGlowIntensity: number;
|
|
983
|
+
shakeOffset: number;
|
|
984
|
+
bounceOffset: number;
|
|
985
|
+
slideOffset: number;
|
|
986
|
+
pressButton: () => void;
|
|
987
|
+
releaseButton: () => void;
|
|
988
|
+
setButtonState: (state: 'idle' | 'hover' | 'active' | 'focus' | 'disabled') => void;
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
interface VisibilityToggleOptions extends BaseMotionOptions {
|
|
992
|
+
showScale?: number;
|
|
993
|
+
showOpacity?: number;
|
|
994
|
+
showRotate?: number;
|
|
995
|
+
showTranslateY?: number;
|
|
996
|
+
showTranslateX?: number;
|
|
997
|
+
hideScale?: number;
|
|
998
|
+
hideOpacity?: number;
|
|
999
|
+
hideRotate?: number;
|
|
1000
|
+
hideTranslateY?: number;
|
|
1001
|
+
hideTranslateX?: number;
|
|
1002
|
+
}
|
|
1003
|
+
declare function useVisibilityToggle<T extends MotionElement = HTMLDivElement>(options?: VisibilityToggleOptions): InteractionReturn<T>;
|
|
1004
|
+
|
|
1005
|
+
interface ScrollToggleOptions extends BaseMotionOptions {
|
|
1006
|
+
showScale?: number;
|
|
1007
|
+
showOpacity?: number;
|
|
1008
|
+
showRotate?: number;
|
|
1009
|
+
showTranslateY?: number;
|
|
1010
|
+
showTranslateX?: number;
|
|
1011
|
+
hideScale?: number;
|
|
1012
|
+
hideOpacity?: number;
|
|
1013
|
+
hideRotate?: number;
|
|
1014
|
+
hideTranslateY?: number;
|
|
1015
|
+
hideTranslateX?: number;
|
|
1016
|
+
scrollThreshold?: number;
|
|
1017
|
+
scrollDirection?: 'up' | 'down' | 'both';
|
|
1018
|
+
}
|
|
1019
|
+
declare function useScrollToggle<T extends MotionElement = HTMLDivElement>(options?: ScrollToggleOptions): BaseMotionReturn<T>;
|
|
1020
|
+
|
|
1021
|
+
interface CardListOptions extends BaseMotionOptions {
|
|
1022
|
+
staggerDelay?: number;
|
|
1023
|
+
cardScale?: number;
|
|
1024
|
+
cardOpacity?: number;
|
|
1025
|
+
cardRotate?: number;
|
|
1026
|
+
cardTranslateY?: number;
|
|
1027
|
+
cardTranslateX?: number;
|
|
1028
|
+
initialScale?: number;
|
|
1029
|
+
initialOpacity?: number;
|
|
1030
|
+
initialRotate?: number;
|
|
1031
|
+
initialTranslateY?: number;
|
|
1032
|
+
initialTranslateX?: number;
|
|
1033
|
+
gridColumns?: number;
|
|
1034
|
+
gridGap?: number;
|
|
1035
|
+
}
|
|
1036
|
+
declare function useCardList<T extends MotionElement = HTMLDivElement>(options?: CardListOptions): BaseMotionReturn<T> & {
|
|
1037
|
+
cardStyles: React.CSSProperties[];
|
|
1038
|
+
staggerDelay: number;
|
|
1039
|
+
gridColumns: number;
|
|
1040
|
+
gridGap: number;
|
|
1041
|
+
};
|
|
1042
|
+
|
|
1043
|
+
interface LoadingSpinnerOptions extends BaseMotionOptions {
|
|
1044
|
+
type?: 'rotate' | 'pulse' | 'bounce' | 'wave' | 'dots' | 'bars' | 'custom';
|
|
1045
|
+
rotationSpeed?: number;
|
|
1046
|
+
pulseSpeed?: number;
|
|
1047
|
+
bounceHeight?: number;
|
|
1048
|
+
waveCount?: number;
|
|
1049
|
+
dotCount?: number;
|
|
1050
|
+
barCount?: number;
|
|
1051
|
+
color?: string;
|
|
1052
|
+
backgroundColor?: string;
|
|
1053
|
+
size?: number;
|
|
1054
|
+
thickness?: number;
|
|
1055
|
+
autoStart?: boolean;
|
|
1056
|
+
infinite?: boolean;
|
|
1057
|
+
}
|
|
1058
|
+
declare function useLoadingSpinner<T extends MotionElement = HTMLDivElement>(options?: LoadingSpinnerOptions): BaseMotionReturn<T> & {
|
|
1059
|
+
isLoading: boolean;
|
|
1060
|
+
spinnerType: string;
|
|
1061
|
+
rotationAngle: number;
|
|
1062
|
+
pulseScale: number;
|
|
1063
|
+
bounceOffset: number;
|
|
1064
|
+
waveProgress: number;
|
|
1065
|
+
dotProgress: number;
|
|
1066
|
+
barProgress: number;
|
|
1067
|
+
startLoading: () => void;
|
|
1068
|
+
stopLoading: () => void;
|
|
1069
|
+
setLoadingState: (loading: boolean) => void;
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
interface NavigationOptions extends BaseMotionOptions {
|
|
1073
|
+
type?: 'slide' | 'fade' | 'scale' | 'rotate' | 'custom';
|
|
1074
|
+
slideDirection?: 'left' | 'right' | 'up' | 'down';
|
|
1075
|
+
staggerDelay?: number;
|
|
1076
|
+
itemScale?: number;
|
|
1077
|
+
itemOpacity?: number;
|
|
1078
|
+
itemRotate?: number;
|
|
1079
|
+
itemTranslateY?: number;
|
|
1080
|
+
itemTranslateX?: number;
|
|
1081
|
+
initialScale?: number;
|
|
1082
|
+
initialOpacity?: number;
|
|
1083
|
+
initialRotate?: number;
|
|
1084
|
+
initialTranslateY?: number;
|
|
1085
|
+
initialTranslateX?: number;
|
|
1086
|
+
activeScale?: number;
|
|
1087
|
+
activeOpacity?: number;
|
|
1088
|
+
activeRotate?: number;
|
|
1089
|
+
activeTranslateY?: number;
|
|
1090
|
+
activeTranslateX?: number;
|
|
1091
|
+
hoverScale?: number;
|
|
1092
|
+
hoverOpacity?: number;
|
|
1093
|
+
hoverRotate?: number;
|
|
1094
|
+
hoverTranslateY?: number;
|
|
1095
|
+
hoverTranslateX?: number;
|
|
1096
|
+
itemCount?: number;
|
|
1097
|
+
autoStart?: boolean;
|
|
1098
|
+
}
|
|
1099
|
+
declare function useNavigation<T extends MotionElement = HTMLDivElement>(options?: NavigationOptions): BaseMotionReturn<T> & {
|
|
1100
|
+
isOpen: boolean;
|
|
1101
|
+
activeIndex: number;
|
|
1102
|
+
itemStyles: React.CSSProperties[];
|
|
1103
|
+
openMenu: () => void;
|
|
1104
|
+
closeMenu: () => void;
|
|
1105
|
+
toggleMenu: () => void;
|
|
1106
|
+
setActiveItem: (index: number) => void;
|
|
1107
|
+
goToNext: () => void;
|
|
1108
|
+
goToPrevious: () => void;
|
|
1109
|
+
};
|
|
1110
|
+
|
|
1111
|
+
interface SkeletonOptions extends BaseMotionOptions {
|
|
1112
|
+
/** 스켈레톤 배경색 */
|
|
1113
|
+
backgroundColor?: string;
|
|
1114
|
+
/** 스켈레톤 하이라이트 색상 */
|
|
1115
|
+
highlightColor?: string;
|
|
1116
|
+
/** 모션 속도 (ms) */
|
|
1117
|
+
motionSpeed?: number;
|
|
1118
|
+
/** 스켈레톤 높이 */
|
|
1119
|
+
height?: number;
|
|
1120
|
+
/** 스켈레톤 너비 */
|
|
1121
|
+
width?: number | string;
|
|
1122
|
+
/** 보더 반지름 */
|
|
1123
|
+
borderRadius?: number;
|
|
1124
|
+
/** 웨이브 모션 활성화 여부 */
|
|
1125
|
+
wave?: boolean;
|
|
1126
|
+
/** 펄스 모션 활성화 여부 */
|
|
1127
|
+
pulse?: boolean;
|
|
1128
|
+
}
|
|
1129
|
+
declare function useSkeleton<T extends MotionElement = HTMLDivElement>(options?: SkeletonOptions): BaseMotionReturn<T>;
|
|
1130
|
+
|
|
1064
1131
|
interface TypewriterOptions {
|
|
1065
1132
|
/** 타이핑할 텍스트 */
|
|
1066
1133
|
text: string;
|
|
@@ -1236,6 +1303,9 @@ interface ElementProgressReturn<T extends HTMLElement = HTMLElement> {
|
|
|
1236
1303
|
* useScrollProgress의 확장판. 페이지 전체가 아니라
|
|
1237
1304
|
* 특정 요소가 뷰포트를 통과하는 진행률을 추적합니다.
|
|
1238
1305
|
*
|
|
1306
|
+
* 공유 스크롤 리스너(subscribeScroll)를 사용해 N개 인스턴스도
|
|
1307
|
+
* 단 하나의 scroll/resize 이벤트 + rAF 배칭으로 처리됩니다.
|
|
1308
|
+
*
|
|
1239
1309
|
* @example
|
|
1240
1310
|
* ```tsx
|
|
1241
1311
|
* const { ref, progress, isInView } = useElementProgress<HTMLDivElement>()
|
|
@@ -1263,6 +1333,172 @@ declare function getPagePreset(pageType: PageType): PageMotionsConfig;
|
|
|
1263
1333
|
*/
|
|
1264
1334
|
declare function getMotionPreset(type: string): MotionPreset;
|
|
1265
1335
|
|
|
1336
|
+
/** 프로필 전체의 기본 모션 디폴트 */
|
|
1337
|
+
interface MotionProfileBase {
|
|
1338
|
+
/** 기본 duration (ms) */
|
|
1339
|
+
duration: number;
|
|
1340
|
+
/** 기본 easing (CSS 또는 named preset) */
|
|
1341
|
+
easing: string;
|
|
1342
|
+
/** IntersectionObserver 임계값 */
|
|
1343
|
+
threshold: number;
|
|
1344
|
+
/** 한 번만 트리거할지 여부 */
|
|
1345
|
+
triggerOnce: boolean;
|
|
1346
|
+
}
|
|
1347
|
+
/** 입장 애니메이션 디폴트 */
|
|
1348
|
+
interface MotionProfileEntrance {
|
|
1349
|
+
slide: {
|
|
1350
|
+
/** 슬라이드 거리 (px) */
|
|
1351
|
+
distance: number;
|
|
1352
|
+
/** 슬라이드 전용 이징 */
|
|
1353
|
+
easing: string;
|
|
1354
|
+
};
|
|
1355
|
+
fade: {
|
|
1356
|
+
/** 초기 투명도 */
|
|
1357
|
+
initialOpacity: number;
|
|
1358
|
+
};
|
|
1359
|
+
scale: {
|
|
1360
|
+
/** 초기 스케일 (useScrollReveal/useStagger용, 0.95 등 미세 변화) */
|
|
1361
|
+
from: number;
|
|
1362
|
+
};
|
|
1363
|
+
bounce: {
|
|
1364
|
+
/** 바운스 강도 */
|
|
1365
|
+
intensity: number;
|
|
1366
|
+
/** 바운스 전용 이징 */
|
|
1367
|
+
easing: string;
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
/** 스태거 디폴트 */
|
|
1371
|
+
interface MotionProfileStagger {
|
|
1372
|
+
/** 아이템 간 딜레이 (ms) */
|
|
1373
|
+
perItem: number;
|
|
1374
|
+
/** 첫 아이템 전 딜레이 (ms) */
|
|
1375
|
+
baseDelay: number;
|
|
1376
|
+
}
|
|
1377
|
+
/** 인터랙션 디폴트 */
|
|
1378
|
+
interface MotionProfileInteraction {
|
|
1379
|
+
hover: {
|
|
1380
|
+
/** 호버 시 스케일 */
|
|
1381
|
+
scale: number;
|
|
1382
|
+
/** 호버 시 Y 오프셋 (px) */
|
|
1383
|
+
y: number;
|
|
1384
|
+
/** 호버 duration (ms) */
|
|
1385
|
+
duration: number;
|
|
1386
|
+
/** 호버 이징 */
|
|
1387
|
+
easing: string;
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
/** 스프링 물리 디폴트 */
|
|
1391
|
+
interface MotionProfileSpring {
|
|
1392
|
+
/** 질량 */
|
|
1393
|
+
mass: number;
|
|
1394
|
+
/** 강성 */
|
|
1395
|
+
stiffness: number;
|
|
1396
|
+
/** 감쇠 */
|
|
1397
|
+
damping: number;
|
|
1398
|
+
/** 정지 임계값 */
|
|
1399
|
+
restDelta: number;
|
|
1400
|
+
/** 정지 속도 */
|
|
1401
|
+
restSpeed: number;
|
|
1402
|
+
}
|
|
1403
|
+
/** reduced motion 전략 */
|
|
1404
|
+
type ReducedMotionStrategy = 'skip' | 'fade-only' | 'minimal';
|
|
1405
|
+
/** 전체 Motion Profile */
|
|
1406
|
+
interface MotionProfile {
|
|
1407
|
+
/** 프로필 이름 */
|
|
1408
|
+
name: string;
|
|
1409
|
+
/** 공통 디폴트 */
|
|
1410
|
+
base: MotionProfileBase;
|
|
1411
|
+
/** 입장 애니메이션 */
|
|
1412
|
+
entrance: MotionProfileEntrance;
|
|
1413
|
+
/** 스태거 */
|
|
1414
|
+
stagger: MotionProfileStagger;
|
|
1415
|
+
/** 인터랙션 */
|
|
1416
|
+
interaction: MotionProfileInteraction;
|
|
1417
|
+
/** 스프링 물리 */
|
|
1418
|
+
spring: MotionProfileSpring;
|
|
1419
|
+
/** reduced motion 전략 */
|
|
1420
|
+
reducedMotion: ReducedMotionStrategy;
|
|
1421
|
+
}
|
|
1422
|
+
/** 내장 프로필 이름 */
|
|
1423
|
+
type BuiltInProfileName = 'neutral' | 'hua';
|
|
1424
|
+
/** DeepPartial 유틸리티 */
|
|
1425
|
+
type DeepPartial<T> = {
|
|
1426
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* neutral 프로필 — 기존 하드코딩 디폴트와 동일.
|
|
1431
|
+
* Provider 없을 때 fallback으로 사용되므로 하위 호환 100% 보장.
|
|
1432
|
+
*/
|
|
1433
|
+
declare const neutral: MotionProfile;
|
|
1434
|
+
|
|
1435
|
+
/**
|
|
1436
|
+
* HUA 프로필 — 스르륵 쫀뜩한 브랜드 시그니처.
|
|
1437
|
+
*
|
|
1438
|
+
* 특징:
|
|
1439
|
+
* - CSS ease-out 기반이되 끝에 미세한 오버슈트 (1.04~1.06)
|
|
1440
|
+
* - 도착점을 살짝 지나쳤다가 돌아오는 탄성
|
|
1441
|
+
* - 바운스 없이 쫀뜩 (높은 감쇠 + 높은 강성)
|
|
1442
|
+
* - neutral보다 짧은 duration, 좁은 distance → 더 정교한 느낌
|
|
1443
|
+
*/
|
|
1444
|
+
declare const hua: MotionProfile;
|
|
1445
|
+
|
|
1446
|
+
interface MotionProfileProviderProps {
|
|
1447
|
+
/** 내장 프로필 이름 또는 커스텀 프로필 객체 */
|
|
1448
|
+
profile?: BuiltInProfileName | MotionProfile;
|
|
1449
|
+
/** 선택한 프로필 위에 부분 오버라이드 */
|
|
1450
|
+
overrides?: DeepPartial<MotionProfile>;
|
|
1451
|
+
children: React.ReactNode;
|
|
1452
|
+
}
|
|
1453
|
+
declare function MotionProfileProvider({ profile, overrides, children, }: MotionProfileProviderProps): react.FunctionComponentElement<react.ProviderProps<MotionProfile>>;
|
|
1454
|
+
/**
|
|
1455
|
+
* 현재 프로필을 가져옴.
|
|
1456
|
+
* Provider 밖에서 호출 시 neutral 프로필 반환 (하위 호환).
|
|
1457
|
+
*/
|
|
1458
|
+
declare function useMotionProfile(): MotionProfile;
|
|
1459
|
+
|
|
1460
|
+
/** 이름 또는 객체에서 프로필 resolve */
|
|
1461
|
+
declare function resolveProfile(profile: BuiltInProfileName | MotionProfile): MotionProfile;
|
|
1462
|
+
/** 프로필에 오버라이드를 깊은 병합 */
|
|
1463
|
+
declare function mergeProfileOverrides(base: MotionProfile, overrides: DeepPartial<MotionProfile>): MotionProfile;
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Shared IntersectionObserver Pool
|
|
1467
|
+
*
|
|
1468
|
+
* threshold|rootMargin 조합별로 하나의 IntersectionObserver를 공유합니다.
|
|
1469
|
+
* N개 훅 = K개 observer (K = 고유 옵션 조합 수, 보통 1~3).
|
|
1470
|
+
*
|
|
1471
|
+
* sharedScroll.ts와 동일한 singleton pool 패턴.
|
|
1472
|
+
*
|
|
1473
|
+
* @example
|
|
1474
|
+
* ```ts
|
|
1475
|
+
* useEffect(() => {
|
|
1476
|
+
* if (!ref.current) return
|
|
1477
|
+
* return observeElement(
|
|
1478
|
+
* ref.current,
|
|
1479
|
+
* (entry) => { if (entry.isIntersecting) start() },
|
|
1480
|
+
* { threshold: 0.1 },
|
|
1481
|
+
* true // once
|
|
1482
|
+
* )
|
|
1483
|
+
* }, [])
|
|
1484
|
+
* ```
|
|
1485
|
+
*/
|
|
1486
|
+
type EntryCallback = (entry: IntersectionObserverEntry) => void;
|
|
1487
|
+
/**
|
|
1488
|
+
* element를 공유 IntersectionObserver에 등록.
|
|
1489
|
+
* 반환 함수를 호출하면 구독 해제.
|
|
1490
|
+
*
|
|
1491
|
+
* @param element - 관찰할 DOM element
|
|
1492
|
+
* @param callback - intersection 변화 시 호출되는 콜백 (해당 element의 entry만 전달)
|
|
1493
|
+
* @param options - threshold, rootMargin
|
|
1494
|
+
* @param once - true이면 첫 intersection 후 자동 unsubscribe
|
|
1495
|
+
* @returns unsubscribe 함수
|
|
1496
|
+
*/
|
|
1497
|
+
declare function observeElement(element: Element, callback: EntryCallback, options?: {
|
|
1498
|
+
threshold?: number | number[];
|
|
1499
|
+
rootMargin?: string;
|
|
1500
|
+
}, once?: boolean): () => void;
|
|
1501
|
+
|
|
1266
1502
|
type EasingFunction = (t: number) => number;
|
|
1267
1503
|
declare const linear: EasingFunction;
|
|
1268
1504
|
declare const easeIn: EasingFunction;
|
|
@@ -1290,6 +1526,31 @@ declare const easingPresets: {
|
|
|
1290
1526
|
};
|
|
1291
1527
|
declare function getPresetEasing(preset: keyof typeof easingPresets): EasingFunction;
|
|
1292
1528
|
|
|
1529
|
+
/**
|
|
1530
|
+
* Spring physics calculation (Hooke's Law + damping)
|
|
1531
|
+
*
|
|
1532
|
+
* Pure function — no side effects, fully testable.
|
|
1533
|
+
*/
|
|
1534
|
+
interface SpringConfig {
|
|
1535
|
+
stiffness: number;
|
|
1536
|
+
damping: number;
|
|
1537
|
+
mass: number;
|
|
1538
|
+
}
|
|
1539
|
+
interface SpringResult {
|
|
1540
|
+
value: number;
|
|
1541
|
+
velocity: number;
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Calculate one step of a damped spring simulation.
|
|
1545
|
+
*
|
|
1546
|
+
* @param currentValue Current position
|
|
1547
|
+
* @param currentVelocity Current velocity
|
|
1548
|
+
* @param targetValue Equilibrium (target) position
|
|
1549
|
+
* @param deltaTime Time step in seconds
|
|
1550
|
+
* @param config Spring parameters (stiffness, damping, mass)
|
|
1551
|
+
*/
|
|
1552
|
+
declare function calculateSpring(currentValue: number, currentVelocity: number, targetValue: number, deltaTime: number, config: SpringConfig): SpringResult;
|
|
1553
|
+
|
|
1293
1554
|
type MotionAs = 'div' | 'span' | 'section' | 'article' | 'header' | 'footer' | 'main' | 'nav';
|
|
1294
1555
|
interface MotionProps extends react__default.HTMLAttributes<HTMLElement> {
|
|
1295
1556
|
/** HTML 요소 타입 @default 'div' */
|
|
@@ -1363,4 +1624,4 @@ interface UseStaggerReturn {
|
|
|
1363
1624
|
*/
|
|
1364
1625
|
declare function useStagger(options: UseStaggerOptions): UseStaggerReturn;
|
|
1365
1626
|
|
|
1366
|
-
export { type BaseMotionOptions, type BaseMotionReturn, type BounceOptions, type CustomCursorOptions, type CustomCursorReturn, type EasingFunction, type EasingType, type ElementProgressOptions, type ElementProgressReturn, type EntranceType, type FadeInOptions, type GestureConfig, type GestureOptions$1 as GestureOptions, type GradientOptions, type HoverMotionOptions, type InViewOptions, type InViewReturn, type InteractionReturn, MOTION_PRESETS, type MagneticCursorOptions, type MagneticCursorReturn, Motion, type MotionCallback, type MotionConfig, type MotionDirection$1 as MotionDirection, type MotionEasing, type MotionEffects, type MotionElement, MotionEngine, type MotionFrame, type Motion$1 as MotionInstance, type MotionOptions, type MotionPreset, type MotionProgressCallback, type MotionProps, type MotionState$1 as MotionState, type MotionStateCallback, type MotionTrigger, type MotionType$1 as MotionType, type MouseOptions, type MouseReturn, type
|
|
1627
|
+
export { type BaseMotionOptions, type BaseMotionReturn, type BounceOptions, type BuiltInProfileName, type ButtonEffectOptions, type CardListOptions, type CustomCursorOptions, type CustomCursorReturn, type DeepPartial, type EasingFunction, type EasingType, type ElementProgressOptions, type ElementProgressReturn, type EntranceType, type FadeInOptions, type GestureConfig, type GestureOptions$1 as GestureOptions, type GradientOptions, type HoverMotionOptions, type InViewOptions, type InViewReturn, type InteractionReturn, type LoadingSpinnerOptions, MOTION_PRESETS, type MagneticCursorOptions, type MagneticCursorReturn, Motion, type MotionCallback, type MotionConfig, type MotionDirection$1 as MotionDirection, type MotionEasing, type MotionEffects, type MotionElement, MotionEngine, type MotionFrame, type Motion$1 as MotionInstance, type MotionOptions, type MotionPreset, type MotionProfile, type MotionProfileBase, type MotionProfileEntrance, type MotionProfileInteraction, MotionProfileProvider, type MotionProfileProviderProps, type MotionProfileSpring, type MotionProfileStagger, type MotionProgressCallback, type MotionProps, type MotionState$1 as MotionState, type MotionStateCallback, type MotionTrigger, type MotionType$1 as MotionType, type MouseOptions, type MouseReturn, type NavigationOptions, type OrchestrationConfig, PAGE_MOTIONS, type PageMotionElement, type PageMotionRef, type PageMotionsConfig, type PageType, type PerformanceMetrics, type PresetConfig, type PulseOptions, type ReducedMotionReturn, type ReducedMotionStrategy, type RepeatOptions, type ScaleOptions, type ScrollRevealMotionType, type ScrollRevealOptions, type ScrollToggleOptions, type SkeletonOptions, type SlideOptions, type SmoothScrollOptions, type SmoothScrollReturn, type SpringConfig$1 as SpringConfig, type SpringOptions, type SpringConfig as SpringPhysicsConfig, type SpringResult, type ToggleMotionOptions, TransitionEffects, type TransitionOptions, type TransitionType, type TypewriterOptions, type TypewriterReturn, type UseStaggerOptions, type UseStaggerReturn, type UseUnifiedMotionOptions, type VisibilityToggleOptions, type WindowSizeOptions, type WindowSizeReturn, applyEasing, calculateSpring, easeIn, easeInOut, easeInOutQuad, easeInQuad, easeOut, easeOutQuad, easingPresets, getAvailableEasings, getEasing, getMotionPreset, getPagePreset, getPresetEasing, hua, isEasingFunction, isValidEasing, linear, mergeProfileOverrides, mergeWithPreset, motionEngine, neutral, observeElement, resolveProfile, safeApplyEasing, transitionEffects, useBounceIn, useButtonEffect, useCardList, useClickToggle, useCustomCursor, useElementProgress, useFadeIn, useFocusToggle, useGesture, useGestureMotion, useGradient, useHoverMotion, useInView, useLoadingSpinner, useMagneticCursor, useMotionProfile, useMotionState, useMouse, useNavigation, usePageMotions, usePulse, useReducedMotion, useRepeat, useScaleIn, useScrollProgress, useScrollReveal, useScrollToggle, useSimplePageMotion, useSkeleton, useSlideDown, useSlideLeft, useSlideRight, useSlideUp, useSmartMotion, useSmoothScroll, useSpringMotion, useStagger, useToggleMotion, useTypewriter, useUnifiedMotion, useVisibilityToggle, useWindowSize };
|