@hua-labs/motion-core 2.4.0 → 2.4.1

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/native.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MotionElement, _ as MotionState } from './springPhysics-DLyZ4nbx.mjs';
2
- export { B as BaseMotionOptions, e as BounceOptions, p as BuiltInProfileName, D as DeepPartial, q as EasingFunction, r as EasingType, F as FadeInOptions, u as MOTION_PRESETS, v as MotionCallback, x as MotionDirection, y as MotionEasing, z as MotionEngine, A as MotionFrame, C as MotionInstance, J as MotionOptions, L as MotionProfile, N as MotionProfileBase, O as MotionProfileEntrance, Q as MotionProfileInteraction, U as MotionProfileProvider, V as MotionProfileProviderProps, X as MotionProfileSpring, Y as MotionProfileStagger, Z as MotionProgressCallback, a0 as MotionTrigger, a3 as PAGE_MOTIONS, f as PulseOptions, a7 as ReducedMotionStrategy, d as ScaleOptions, S as SlideOptions, a8 as SpringConfig, g as SpringOptions, a9 as SpringPhysicsConfig, aa as SpringResult, ab as TransitionEffects, ac as TransitionOptions, ad as TransitionType, ae as applyEasing, af as calculateSpring, ag as easeIn, ah as easeInOut, ai as easeInOutQuad, aj as easeInQuad, ak as easeOut, al as easeOutQuad, am as easingPresets, an as getAvailableEasings, ao as getEasing, ap as getMotionPreset, aq as getPagePreset, ar as getPresetEasing, as as hua, at as isEasingFunction, au as isValidEasing, av as linear, aw as mergeProfileOverrides, ax as mergeWithPreset, ay as motionEngine, az as neutral, aA as resolveProfile, aB as safeApplyEasing, aC as transitionEffects, aD as useMotionProfile } from './springPhysics-DLyZ4nbx.mjs';
1
+ import { M as MotionElement, a0 as MotionState } from './springPhysics-BZVRi9PQ.mjs';
2
+ export { B as BaseMotionOptions, f as BounceOptions, q as BuiltInProfileName, D as DeepPartial, r as EasingFunction, s as EasingType, F as FadeInOptions, v as MOTION_PRESETS, w as MotionCallback, y as MotionDirection, z as MotionEasing, C as MotionEngine, J as MotionFrame, K as MotionInstance, L as MotionOptions, O as MotionProfile, Q as MotionProfileBase, U as MotionProfileEntrance, V as MotionProfileInteraction, X as MotionProfileProvider, Y as MotionProfileProviderProps, Z as MotionProfileSpring, _ as MotionProfileStagger, $ as MotionProgressCallback, a2 as MotionTrigger, a6 as PAGE_MOTIONS, g as PulseOptions, aa as ReducedMotionStrategy, e as ScaleOptions, S as SlideOptions, ac as SpringConfig, h as SpringOptions, ad as SpringPhysicsConfig, ae as SpringResult, ah as TransitionEffects, ai as TransitionOptions, aj as TransitionType, ak as applyEasing, al as calculateSpring, am as easeIn, an as easeInOut, ao as easeInOutQuad, ap as easeInQuad, aq as easeOut, ar as easeOutQuad, as as easingPresets, at as getAvailableEasings, au as getEasing, av as getMotionPreset, aw as getPagePreset, ax as getPresetEasing, ay as hua, az as isEasingFunction, aA as isValidEasing, aB as linear, aC as mergeProfileOverrides, aD as mergeWithPreset, aE as motionEngine, aF as neutral, aG as resolveProfile, aH as safeApplyEasing, aI as transitionEffects, aJ as useMotionProfile } from './springPhysics-BZVRi9PQ.mjs';
3
3
  import { ViewStyle, Animated } from 'react-native';
4
4
  import 'react';
5
5
 
package/dist/native.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MotionElement, _ as MotionState } from './springPhysics-DLyZ4nbx.js';
2
- export { B as BaseMotionOptions, e as BounceOptions, p as BuiltInProfileName, D as DeepPartial, q as EasingFunction, r as EasingType, F as FadeInOptions, u as MOTION_PRESETS, v as MotionCallback, x as MotionDirection, y as MotionEasing, z as MotionEngine, A as MotionFrame, C as MotionInstance, J as MotionOptions, L as MotionProfile, N as MotionProfileBase, O as MotionProfileEntrance, Q as MotionProfileInteraction, U as MotionProfileProvider, V as MotionProfileProviderProps, X as MotionProfileSpring, Y as MotionProfileStagger, Z as MotionProgressCallback, a0 as MotionTrigger, a3 as PAGE_MOTIONS, f as PulseOptions, a7 as ReducedMotionStrategy, d as ScaleOptions, S as SlideOptions, a8 as SpringConfig, g as SpringOptions, a9 as SpringPhysicsConfig, aa as SpringResult, ab as TransitionEffects, ac as TransitionOptions, ad as TransitionType, ae as applyEasing, af as calculateSpring, ag as easeIn, ah as easeInOut, ai as easeInOutQuad, aj as easeInQuad, ak as easeOut, al as easeOutQuad, am as easingPresets, an as getAvailableEasings, ao as getEasing, ap as getMotionPreset, aq as getPagePreset, ar as getPresetEasing, as as hua, at as isEasingFunction, au as isValidEasing, av as linear, aw as mergeProfileOverrides, ax as mergeWithPreset, ay as motionEngine, az as neutral, aA as resolveProfile, aB as safeApplyEasing, aC as transitionEffects, aD as useMotionProfile } from './springPhysics-DLyZ4nbx.js';
1
+ import { M as MotionElement, a0 as MotionState } from './springPhysics-BZVRi9PQ.js';
2
+ export { B as BaseMotionOptions, f as BounceOptions, q as BuiltInProfileName, D as DeepPartial, r as EasingFunction, s as EasingType, F as FadeInOptions, v as MOTION_PRESETS, w as MotionCallback, y as MotionDirection, z as MotionEasing, C as MotionEngine, J as MotionFrame, K as MotionInstance, L as MotionOptions, O as MotionProfile, Q as MotionProfileBase, U as MotionProfileEntrance, V as MotionProfileInteraction, X as MotionProfileProvider, Y as MotionProfileProviderProps, Z as MotionProfileSpring, _ as MotionProfileStagger, $ as MotionProgressCallback, a2 as MotionTrigger, a6 as PAGE_MOTIONS, g as PulseOptions, aa as ReducedMotionStrategy, e as ScaleOptions, S as SlideOptions, ac as SpringConfig, h as SpringOptions, ad as SpringPhysicsConfig, ae as SpringResult, ah as TransitionEffects, ai as TransitionOptions, aj as TransitionType, ak as applyEasing, al as calculateSpring, am as easeIn, an as easeInOut, ao as easeInOutQuad, ap as easeInQuad, aq as easeOut, ar as easeOutQuad, as as easingPresets, at as getAvailableEasings, au as getEasing, av as getMotionPreset, aw as getPagePreset, ax as getPresetEasing, ay as hua, az as isEasingFunction, aA as isValidEasing, aB as linear, aC as mergeProfileOverrides, aD as mergeWithPreset, aE as motionEngine, aF as neutral, aG as resolveProfile, aH as safeApplyEasing, aI as transitionEffects, aJ as useMotionProfile } from './springPhysics-BZVRi9PQ.js';
3
3
  import { ViewStyle, Animated } from 'react-native';
4
4
  import 'react';
5
5
 
@@ -194,10 +194,10 @@ declare const transitionEffects: TransitionEffects;
194
194
 
195
195
  type MotionElement = HTMLDivElement | HTMLSpanElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLImageElement;
196
196
  type MotionStyle = CSSProperties & {
197
- '--motion-delay'?: string;
198
- '--motion-duration'?: string;
199
- '--motion-easing'?: string;
200
- '--motion-progress'?: string;
197
+ "--motion-delay"?: string;
198
+ "--motion-duration"?: string;
199
+ "--motion-easing"?: string;
200
+ "--motion-progress"?: string;
201
201
  };
202
202
  interface BaseMotionOptions {
203
203
  /** 모션 시작 지연 시간 (ms) */
@@ -261,7 +261,7 @@ interface FadeInOptions extends BaseMotionOptions {
261
261
  }
262
262
  interface SlideOptions extends BaseMotionOptions {
263
263
  /** 슬라이드 방향 */
264
- direction?: 'up' | 'down' | 'left' | 'right';
264
+ direction?: "up" | "down" | "left" | "right";
265
265
  /** 슬라이드 거리 (px) */
266
266
  distance?: number;
267
267
  }
@@ -309,9 +309,9 @@ interface GestureOptions extends BaseMotionOptions {
309
309
  /** 틸트 제스처 활성화 */
310
310
  tilt?: boolean;
311
311
  }
312
- type MotionDirection = 'up' | 'down' | 'left' | 'right';
313
- type MotionEasing = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'bounce' | 'elastic';
314
- type MotionTrigger = 'scroll' | 'click' | 'hover' | 'focus' | 'auto';
312
+ type MotionDirection = "up" | "down" | "left" | "right";
313
+ type MotionEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "bounce" | "elastic";
314
+ type MotionTrigger = "scroll" | "click" | "hover" | "focus" | "auto";
315
315
  type MotionCallback = () => void;
316
316
  type MotionProgressCallback = (progress: number) => void;
317
317
  type MotionStateCallback<T extends MotionElement = HTMLDivElement> = (state: BaseMotionReturn<T>) => void;
@@ -333,7 +333,7 @@ interface MotionConfig {
333
333
  /** 디버그 모드 활성화 */
334
334
  debug?: boolean;
335
335
  /** 로그 레벨 */
336
- logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';
336
+ logLevel?: "none" | "error" | "warn" | "info" | "debug";
337
337
  }
338
338
  interface InViewOptions {
339
339
  /** Intersection Observer 임계값 */
@@ -391,7 +391,7 @@ interface WindowSizeReturn {
391
391
  /** 마운트 여부 (SSR 대응) */
392
392
  isMounted: boolean;
393
393
  }
394
- type ScrollRevealMotionType = 'fadeIn' | 'slideUp' | 'slideLeft' | 'slideRight' | 'scaleIn' | 'bounceIn';
394
+ type ScrollRevealMotionType = "fadeIn" | "slideUp" | "slideLeft" | "slideRight" | "scaleIn" | "bounceIn";
395
395
  interface ScrollRevealOptions extends BaseMotionOptions {
396
396
  /** 루트 마진 */
397
397
  rootMargin?: string;
@@ -402,7 +402,7 @@ interface GradientOptions extends BaseMotionOptions {
402
402
  /** 그라디언트 색상 배열 */
403
403
  colors?: string[];
404
404
  /** 그라디언트 방향 */
405
- direction?: 'horizontal' | 'vertical' | 'diagonal';
405
+ direction?: "horizontal" | "vertical" | "diagonal";
406
406
  /** 그라디언트 크기 (%) */
407
407
  size?: number;
408
408
  }
@@ -410,7 +410,7 @@ interface ToggleMotionOptions extends BaseMotionOptions {
410
410
  }
411
411
  interface RepeatOptions extends BaseMotionOptions {
412
412
  /** 반복 효과 타입 */
413
- type?: 'pulse' | 'bounce' | 'wave' | 'fade';
413
+ type?: "pulse" | "bounce" | "wave" | "fade";
414
414
  /** 효과 강도 */
415
415
  intensity?: number;
416
416
  }
@@ -422,10 +422,61 @@ interface HoverMotionOptions extends BaseMotionOptions {
422
422
  /** 호버 시 투명도 */
423
423
  hoverOpacity?: number;
424
424
  }
425
+ /**
426
+ * Standard return type for entrance/exit animation hooks.
427
+ * Used by: useFadeIn, useSlideUp, useScaleIn, useBounceIn, etc.
428
+ */
429
+ interface EntranceMotionReturn<T extends MotionElement = HTMLDivElement> extends BaseMotionReturn<T> {
430
+ /** Pause the animation */
431
+ pause: () => void;
432
+ /** Resume a paused animation */
433
+ resume: () => void;
434
+ }
435
+ /**
436
+ * Standard return type for style-only hooks (no animation controls).
437
+ * Used by: useBlurIn, useClipReveal, etc.
438
+ */
439
+ interface StyleMotionReturn<T extends MotionElement = HTMLDivElement> {
440
+ ref: RefObject<T | null>;
441
+ style: MotionStyle;
442
+ isVisible: boolean;
443
+ }
444
+ /**
445
+ * Standard return type for toggle/interaction hooks.
446
+ * Used by: useClickToggle, useFocusToggle, useKeyboardToggle, etc.
447
+ */
448
+ interface ToggleMotionReturn<T extends MotionElement = HTMLDivElement> {
449
+ ref: RefObject<T | null>;
450
+ isActive: boolean;
451
+ mounted: boolean;
452
+ toggle: () => void;
453
+ activate: () => void;
454
+ deactivate: () => void;
455
+ reset: () => void;
456
+ }
457
+ /**
458
+ * Standard return type for observation/utility hooks.
459
+ * Used by: useInView, useElementProgress, etc.
460
+ */
461
+ interface ObserverReturn<T extends MotionElement = HTMLDivElement> {
462
+ ref: RefObject<T | null>;
463
+ }
464
+ /**
465
+ * Standard return type for auto-looping animation hooks.
466
+ * Used by: useAutoFade, useAutoScale, useAutoSlide, etc.
467
+ */
468
+ interface AutoMotionReturn {
469
+ isAnimating: boolean;
470
+ isVisible: boolean;
471
+ mounted: boolean;
472
+ start: () => void;
473
+ stop: () => void;
474
+ reset: () => void;
475
+ }
425
476
 
426
- type PageType = 'home' | 'dashboard' | 'product' | 'blog';
427
- type MotionType = 'hero' | 'title' | 'button' | 'card' | 'text' | 'image';
428
- type EntranceType = 'fadeIn' | 'slideUp' | 'slideLeft' | 'slideRight' | 'scaleIn' | 'bounceIn';
477
+ type PageType = "home" | "dashboard" | "product" | "blog";
478
+ type MotionType = "hero" | "title" | "button" | "card" | "text" | "image";
479
+ type EntranceType = "fadeIn" | "slideUp" | "slideLeft" | "slideRight" | "scaleIn" | "bounceIn";
429
480
  interface PageMotionElement {
430
481
  type: MotionType;
431
482
  entrance?: EntranceType;
@@ -482,8 +533,10 @@ interface GestureConfig {
482
533
  swipe?: boolean;
483
534
  tilt?: boolean;
484
535
  }
485
- interface OrchestrationConfig {
486
- sequence?: 'sequential' | 'parallel' | 'stagger';
536
+ /** @deprecated Renamed to SequenceOrchestrationConfig to avoid collision with useOrchestration's config. */
537
+ type OrchestrationConfig = SequenceOrchestrationConfig;
538
+ interface SequenceOrchestrationConfig {
539
+ sequence?: "sequential" | "parallel" | "stagger";
487
540
  staggerDelay?: number;
488
541
  staggerDuration?: number;
489
542
  }
@@ -684,4 +737,4 @@ interface SpringResult {
684
737
  */
685
738
  declare function calculateSpring(currentValue: number, currentVelocity: number, targetValue: number, deltaTime: number, config: SpringConfig): SpringResult;
686
739
 
687
- export { type MotionStateCallback as $, type MotionFrame as A, type BaseMotionOptions as B, type Motion as C, type DeepPartial as D, type EntranceType as E, type FadeInOptions as F, type GradientOptions as G, type HoverMotionOptions as H, type InteractionReturn as I, type MotionOptions as J, type MotionPreset as K, type MotionProfile as L, type MotionElement as M, type MotionProfileBase as N, type MotionProfileEntrance as O, type PageType as P, type MotionProfileInteraction as Q, type RepeatOptions as R, type SlideOptions as S, type ToggleMotionOptions as T, MotionProfileProvider as U, type MotionProfileProviderProps as V, type WindowSizeOptions as W, type MotionProfileSpring as X, type MotionProfileStagger as Y, type MotionProgressCallback as Z, type MotionState as _, type PageMotionRef as a, type MotionTrigger as a0, type MotionType as a1, type OrchestrationConfig as a2, PAGE_MOTIONS as a3, type PageMotionElement as a4, type PerformanceMetrics as a5, type PresetConfig as a6, type ReducedMotionStrategy as a7, type SpringConfig$1 as a8, type SpringConfig as a9, resolveProfile as aA, safeApplyEasing as aB, transitionEffects as aC, useMotionProfile as aD, type SpringResult as aa, TransitionEffects as ab, type TransitionOptions as ac, type TransitionType as ad, applyEasing as ae, calculateSpring as af, easeIn as ag, easeInOut as ah, easeInOutQuad as ai, easeInQuad as aj, easeOut as ak, easeOutQuad as al, easingPresets as am, getAvailableEasings as an, getEasing as ao, getMotionPreset as ap, getPagePreset as aq, getPresetEasing as ar, hua as as, isEasingFunction as at, isValidEasing as au, linear as av, mergeProfileOverrides as aw, mergeWithPreset as ax, motionEngine as ay, neutral as az, type PageMotionsConfig as b, type BaseMotionReturn as c, type ScaleOptions as d, type BounceOptions as e, type PulseOptions as f, type SpringOptions as g, type ScrollRevealOptions as h, type InViewOptions as i, type InViewReturn as j, type MouseOptions as k, type MouseReturn as l, type ReducedMotionReturn as m, type WindowSizeReturn as n, type ScrollRevealMotionType as o, type BuiltInProfileName as p, type EasingFunction as q, type EasingType as r, type GestureConfig as s, type GestureOptions as t, MOTION_PRESETS as u, type MotionCallback as v, type MotionConfig as w, type MotionDirection as x, type MotionEasing as y, MotionEngine as z };
740
+ export { type MotionProgressCallback as $, type AutoMotionReturn as A, type BaseMotionOptions as B, MotionEngine as C, type DeepPartial as D, type EntranceType as E, type FadeInOptions as F, type GradientOptions as G, type HoverMotionOptions as H, type InteractionReturn as I, type MotionFrame as J, type Motion as K, type MotionOptions as L, type MotionElement as M, type MotionPreset as N, type MotionProfile as O, type PageType as P, type MotionProfileBase as Q, type RepeatOptions as R, type SlideOptions as S, type ToggleMotionOptions as T, type MotionProfileEntrance as U, type MotionProfileInteraction as V, type WindowSizeOptions as W, MotionProfileProvider as X, type MotionProfileProviderProps as Y, type MotionProfileSpring as Z, type MotionProfileStagger as _, type PageMotionRef as a, type MotionState as a0, type MotionStateCallback as a1, type MotionTrigger as a2, type MotionType as a3, type ObserverReturn as a4, type OrchestrationConfig as a5, PAGE_MOTIONS as a6, type PageMotionElement as a7, type PerformanceMetrics as a8, type PresetConfig as a9, isValidEasing as aA, linear as aB, mergeProfileOverrides as aC, mergeWithPreset as aD, motionEngine as aE, neutral as aF, resolveProfile as aG, safeApplyEasing as aH, transitionEffects as aI, useMotionProfile as aJ, type ReducedMotionStrategy as aa, type SequenceOrchestrationConfig as ab, type SpringConfig$1 as ac, type SpringConfig as ad, type SpringResult as ae, type StyleMotionReturn as af, type ToggleMotionReturn as ag, TransitionEffects as ah, type TransitionOptions as ai, type TransitionType as aj, applyEasing as ak, calculateSpring as al, easeIn as am, easeInOut as an, easeInOutQuad as ao, easeInQuad as ap, easeOut as aq, easeOutQuad as ar, easingPresets as as, getAvailableEasings as at, getEasing as au, getMotionPreset as av, getPagePreset as aw, getPresetEasing as ax, hua as ay, isEasingFunction as az, type PageMotionsConfig as b, type BaseMotionReturn as c, type EntranceMotionReturn as d, type ScaleOptions as e, type BounceOptions as f, type PulseOptions as g, type SpringOptions as h, type ScrollRevealOptions as i, type InViewOptions as j, type InViewReturn as k, type MouseOptions as l, type MouseReturn as m, type ReducedMotionReturn as n, type WindowSizeReturn as o, type ScrollRevealMotionType as p, type BuiltInProfileName as q, type EasingFunction as r, type EasingType as s, type GestureConfig as t, type GestureOptions as u, MOTION_PRESETS as v, type MotionCallback as w, type MotionConfig as x, type MotionDirection as y, type MotionEasing as z };
@@ -194,10 +194,10 @@ declare const transitionEffects: TransitionEffects;
194
194
 
195
195
  type MotionElement = HTMLDivElement | HTMLSpanElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLImageElement;
196
196
  type MotionStyle = CSSProperties & {
197
- '--motion-delay'?: string;
198
- '--motion-duration'?: string;
199
- '--motion-easing'?: string;
200
- '--motion-progress'?: string;
197
+ "--motion-delay"?: string;
198
+ "--motion-duration"?: string;
199
+ "--motion-easing"?: string;
200
+ "--motion-progress"?: string;
201
201
  };
202
202
  interface BaseMotionOptions {
203
203
  /** 모션 시작 지연 시간 (ms) */
@@ -261,7 +261,7 @@ interface FadeInOptions extends BaseMotionOptions {
261
261
  }
262
262
  interface SlideOptions extends BaseMotionOptions {
263
263
  /** 슬라이드 방향 */
264
- direction?: 'up' | 'down' | 'left' | 'right';
264
+ direction?: "up" | "down" | "left" | "right";
265
265
  /** 슬라이드 거리 (px) */
266
266
  distance?: number;
267
267
  }
@@ -309,9 +309,9 @@ interface GestureOptions extends BaseMotionOptions {
309
309
  /** 틸트 제스처 활성화 */
310
310
  tilt?: boolean;
311
311
  }
312
- type MotionDirection = 'up' | 'down' | 'left' | 'right';
313
- type MotionEasing = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'bounce' | 'elastic';
314
- type MotionTrigger = 'scroll' | 'click' | 'hover' | 'focus' | 'auto';
312
+ type MotionDirection = "up" | "down" | "left" | "right";
313
+ type MotionEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "bounce" | "elastic";
314
+ type MotionTrigger = "scroll" | "click" | "hover" | "focus" | "auto";
315
315
  type MotionCallback = () => void;
316
316
  type MotionProgressCallback = (progress: number) => void;
317
317
  type MotionStateCallback<T extends MotionElement = HTMLDivElement> = (state: BaseMotionReturn<T>) => void;
@@ -333,7 +333,7 @@ interface MotionConfig {
333
333
  /** 디버그 모드 활성화 */
334
334
  debug?: boolean;
335
335
  /** 로그 레벨 */
336
- logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';
336
+ logLevel?: "none" | "error" | "warn" | "info" | "debug";
337
337
  }
338
338
  interface InViewOptions {
339
339
  /** Intersection Observer 임계값 */
@@ -391,7 +391,7 @@ interface WindowSizeReturn {
391
391
  /** 마운트 여부 (SSR 대응) */
392
392
  isMounted: boolean;
393
393
  }
394
- type ScrollRevealMotionType = 'fadeIn' | 'slideUp' | 'slideLeft' | 'slideRight' | 'scaleIn' | 'bounceIn';
394
+ type ScrollRevealMotionType = "fadeIn" | "slideUp" | "slideLeft" | "slideRight" | "scaleIn" | "bounceIn";
395
395
  interface ScrollRevealOptions extends BaseMotionOptions {
396
396
  /** 루트 마진 */
397
397
  rootMargin?: string;
@@ -402,7 +402,7 @@ interface GradientOptions extends BaseMotionOptions {
402
402
  /** 그라디언트 색상 배열 */
403
403
  colors?: string[];
404
404
  /** 그라디언트 방향 */
405
- direction?: 'horizontal' | 'vertical' | 'diagonal';
405
+ direction?: "horizontal" | "vertical" | "diagonal";
406
406
  /** 그라디언트 크기 (%) */
407
407
  size?: number;
408
408
  }
@@ -410,7 +410,7 @@ interface ToggleMotionOptions extends BaseMotionOptions {
410
410
  }
411
411
  interface RepeatOptions extends BaseMotionOptions {
412
412
  /** 반복 효과 타입 */
413
- type?: 'pulse' | 'bounce' | 'wave' | 'fade';
413
+ type?: "pulse" | "bounce" | "wave" | "fade";
414
414
  /** 효과 강도 */
415
415
  intensity?: number;
416
416
  }
@@ -422,10 +422,61 @@ interface HoverMotionOptions extends BaseMotionOptions {
422
422
  /** 호버 시 투명도 */
423
423
  hoverOpacity?: number;
424
424
  }
425
+ /**
426
+ * Standard return type for entrance/exit animation hooks.
427
+ * Used by: useFadeIn, useSlideUp, useScaleIn, useBounceIn, etc.
428
+ */
429
+ interface EntranceMotionReturn<T extends MotionElement = HTMLDivElement> extends BaseMotionReturn<T> {
430
+ /** Pause the animation */
431
+ pause: () => void;
432
+ /** Resume a paused animation */
433
+ resume: () => void;
434
+ }
435
+ /**
436
+ * Standard return type for style-only hooks (no animation controls).
437
+ * Used by: useBlurIn, useClipReveal, etc.
438
+ */
439
+ interface StyleMotionReturn<T extends MotionElement = HTMLDivElement> {
440
+ ref: RefObject<T | null>;
441
+ style: MotionStyle;
442
+ isVisible: boolean;
443
+ }
444
+ /**
445
+ * Standard return type for toggle/interaction hooks.
446
+ * Used by: useClickToggle, useFocusToggle, useKeyboardToggle, etc.
447
+ */
448
+ interface ToggleMotionReturn<T extends MotionElement = HTMLDivElement> {
449
+ ref: RefObject<T | null>;
450
+ isActive: boolean;
451
+ mounted: boolean;
452
+ toggle: () => void;
453
+ activate: () => void;
454
+ deactivate: () => void;
455
+ reset: () => void;
456
+ }
457
+ /**
458
+ * Standard return type for observation/utility hooks.
459
+ * Used by: useInView, useElementProgress, etc.
460
+ */
461
+ interface ObserverReturn<T extends MotionElement = HTMLDivElement> {
462
+ ref: RefObject<T | null>;
463
+ }
464
+ /**
465
+ * Standard return type for auto-looping animation hooks.
466
+ * Used by: useAutoFade, useAutoScale, useAutoSlide, etc.
467
+ */
468
+ interface AutoMotionReturn {
469
+ isAnimating: boolean;
470
+ isVisible: boolean;
471
+ mounted: boolean;
472
+ start: () => void;
473
+ stop: () => void;
474
+ reset: () => void;
475
+ }
425
476
 
426
- type PageType = 'home' | 'dashboard' | 'product' | 'blog';
427
- type MotionType = 'hero' | 'title' | 'button' | 'card' | 'text' | 'image';
428
- type EntranceType = 'fadeIn' | 'slideUp' | 'slideLeft' | 'slideRight' | 'scaleIn' | 'bounceIn';
477
+ type PageType = "home" | "dashboard" | "product" | "blog";
478
+ type MotionType = "hero" | "title" | "button" | "card" | "text" | "image";
479
+ type EntranceType = "fadeIn" | "slideUp" | "slideLeft" | "slideRight" | "scaleIn" | "bounceIn";
429
480
  interface PageMotionElement {
430
481
  type: MotionType;
431
482
  entrance?: EntranceType;
@@ -482,8 +533,10 @@ interface GestureConfig {
482
533
  swipe?: boolean;
483
534
  tilt?: boolean;
484
535
  }
485
- interface OrchestrationConfig {
486
- sequence?: 'sequential' | 'parallel' | 'stagger';
536
+ /** @deprecated Renamed to SequenceOrchestrationConfig to avoid collision with useOrchestration's config. */
537
+ type OrchestrationConfig = SequenceOrchestrationConfig;
538
+ interface SequenceOrchestrationConfig {
539
+ sequence?: "sequential" | "parallel" | "stagger";
487
540
  staggerDelay?: number;
488
541
  staggerDuration?: number;
489
542
  }
@@ -684,4 +737,4 @@ interface SpringResult {
684
737
  */
685
738
  declare function calculateSpring(currentValue: number, currentVelocity: number, targetValue: number, deltaTime: number, config: SpringConfig): SpringResult;
686
739
 
687
- export { type MotionStateCallback as $, type MotionFrame as A, type BaseMotionOptions as B, type Motion as C, type DeepPartial as D, type EntranceType as E, type FadeInOptions as F, type GradientOptions as G, type HoverMotionOptions as H, type InteractionReturn as I, type MotionOptions as J, type MotionPreset as K, type MotionProfile as L, type MotionElement as M, type MotionProfileBase as N, type MotionProfileEntrance as O, type PageType as P, type MotionProfileInteraction as Q, type RepeatOptions as R, type SlideOptions as S, type ToggleMotionOptions as T, MotionProfileProvider as U, type MotionProfileProviderProps as V, type WindowSizeOptions as W, type MotionProfileSpring as X, type MotionProfileStagger as Y, type MotionProgressCallback as Z, type MotionState as _, type PageMotionRef as a, type MotionTrigger as a0, type MotionType as a1, type OrchestrationConfig as a2, PAGE_MOTIONS as a3, type PageMotionElement as a4, type PerformanceMetrics as a5, type PresetConfig as a6, type ReducedMotionStrategy as a7, type SpringConfig$1 as a8, type SpringConfig as a9, resolveProfile as aA, safeApplyEasing as aB, transitionEffects as aC, useMotionProfile as aD, type SpringResult as aa, TransitionEffects as ab, type TransitionOptions as ac, type TransitionType as ad, applyEasing as ae, calculateSpring as af, easeIn as ag, easeInOut as ah, easeInOutQuad as ai, easeInQuad as aj, easeOut as ak, easeOutQuad as al, easingPresets as am, getAvailableEasings as an, getEasing as ao, getMotionPreset as ap, getPagePreset as aq, getPresetEasing as ar, hua as as, isEasingFunction as at, isValidEasing as au, linear as av, mergeProfileOverrides as aw, mergeWithPreset as ax, motionEngine as ay, neutral as az, type PageMotionsConfig as b, type BaseMotionReturn as c, type ScaleOptions as d, type BounceOptions as e, type PulseOptions as f, type SpringOptions as g, type ScrollRevealOptions as h, type InViewOptions as i, type InViewReturn as j, type MouseOptions as k, type MouseReturn as l, type ReducedMotionReturn as m, type WindowSizeReturn as n, type ScrollRevealMotionType as o, type BuiltInProfileName as p, type EasingFunction as q, type EasingType as r, type GestureConfig as s, type GestureOptions as t, MOTION_PRESETS as u, type MotionCallback as v, type MotionConfig as w, type MotionDirection as x, type MotionEasing as y, MotionEngine as z };
740
+ export { type MotionProgressCallback as $, type AutoMotionReturn as A, type BaseMotionOptions as B, MotionEngine as C, type DeepPartial as D, type EntranceType as E, type FadeInOptions as F, type GradientOptions as G, type HoverMotionOptions as H, type InteractionReturn as I, type MotionFrame as J, type Motion as K, type MotionOptions as L, type MotionElement as M, type MotionPreset as N, type MotionProfile as O, type PageType as P, type MotionProfileBase as Q, type RepeatOptions as R, type SlideOptions as S, type ToggleMotionOptions as T, type MotionProfileEntrance as U, type MotionProfileInteraction as V, type WindowSizeOptions as W, MotionProfileProvider as X, type MotionProfileProviderProps as Y, type MotionProfileSpring as Z, type MotionProfileStagger as _, type PageMotionRef as a, type MotionState as a0, type MotionStateCallback as a1, type MotionTrigger as a2, type MotionType as a3, type ObserverReturn as a4, type OrchestrationConfig as a5, PAGE_MOTIONS as a6, type PageMotionElement as a7, type PerformanceMetrics as a8, type PresetConfig as a9, isValidEasing as aA, linear as aB, mergeProfileOverrides as aC, mergeWithPreset as aD, motionEngine as aE, neutral as aF, resolveProfile as aG, safeApplyEasing as aH, transitionEffects as aI, useMotionProfile as aJ, type ReducedMotionStrategy as aa, type SequenceOrchestrationConfig as ab, type SpringConfig$1 as ac, type SpringConfig as ad, type SpringResult as ae, type StyleMotionReturn as af, type ToggleMotionReturn as ag, TransitionEffects as ah, type TransitionOptions as ai, type TransitionType as aj, applyEasing as ak, calculateSpring as al, easeIn as am, easeInOut as an, easeInOutQuad as ao, easeInQuad as ap, easeOut as aq, easeOutQuad as ar, easingPresets as as, getAvailableEasings as at, getEasing as au, getMotionPreset as av, getPagePreset as aw, getPresetEasing as ax, hua as ay, isEasingFunction as az, type PageMotionsConfig as b, type BaseMotionReturn as c, type EntranceMotionReturn as d, type ScaleOptions as e, type BounceOptions as f, type PulseOptions as g, type SpringOptions as h, type ScrollRevealOptions as i, type InViewOptions as j, type InViewReturn as k, type MouseOptions as l, type MouseReturn as m, type ReducedMotionReturn as n, type WindowSizeReturn as o, type ScrollRevealMotionType as p, type BuiltInProfileName as q, type EasingFunction as r, type EasingType as s, type GestureConfig as t, type GestureOptions as u, MOTION_PRESETS as v, type MotionCallback as w, type MotionConfig as x, type MotionDirection as y, type MotionEasing as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hua-labs/motion-core",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "HUA Motion Core - Essential animation hooks for React developers",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -32,7 +32,7 @@
32
32
  "@types/node": "^25.3.5",
33
33
  "@types/react": "^19.2.14",
34
34
  "@types/react-dom": "^19.2.3",
35
- "@vitejs/plugin-react": "^5.1.4",
35
+ "@vitejs/plugin-react": "^6.0.1",
36
36
  "eslint": "^10.0.3",
37
37
  "tsup": "^8.5.1",
38
38
  "typescript": "^5.9.3",