@emekaugbanu/trigr 0.4.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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +384 -0
  3. package/dist/animations-DhYFMdig.d.mts +63 -0
  4. package/dist/animations-DhYFMdig.d.ts +63 -0
  5. package/dist/block/animations.cjs +2 -0
  6. package/dist/block/animations.cjs.map +1 -0
  7. package/dist/block/animations.d.mts +13 -0
  8. package/dist/block/animations.d.ts +13 -0
  9. package/dist/block/animations.js +2 -0
  10. package/dist/block/animations.js.map +1 -0
  11. package/dist/block/index.cjs +11 -0
  12. package/dist/block/index.cjs.map +1 -0
  13. package/dist/block/index.d.mts +22 -0
  14. package/dist/block/index.d.ts +22 -0
  15. package/dist/block/index.js +11 -0
  16. package/dist/block/index.js.map +1 -0
  17. package/dist/list/animations.cjs +2 -0
  18. package/dist/list/animations.cjs.map +1 -0
  19. package/dist/list/animations.d.mts +13 -0
  20. package/dist/list/animations.d.ts +13 -0
  21. package/dist/list/animations.js +2 -0
  22. package/dist/list/animations.js.map +1 -0
  23. package/dist/list/index.cjs +2 -0
  24. package/dist/list/index.cjs.map +1 -0
  25. package/dist/list/index.d.mts +10 -0
  26. package/dist/list/index.d.ts +10 -0
  27. package/dist/list/index.js +2 -0
  28. package/dist/list/index.js.map +1 -0
  29. package/dist/paragraph/animations.cjs +2 -0
  30. package/dist/paragraph/animations.cjs.map +1 -0
  31. package/dist/paragraph/animations.d.mts +2 -0
  32. package/dist/paragraph/animations.d.ts +2 -0
  33. package/dist/paragraph/animations.js +2 -0
  34. package/dist/paragraph/animations.js.map +1 -0
  35. package/dist/paragraph/index.cjs +3 -0
  36. package/dist/paragraph/index.cjs.map +1 -0
  37. package/dist/paragraph/index.d.mts +10 -0
  38. package/dist/paragraph/index.d.ts +10 -0
  39. package/dist/paragraph/index.js +3 -0
  40. package/dist/paragraph/index.js.map +1 -0
  41. package/dist/text/animations.cjs +2 -0
  42. package/dist/text/animations.cjs.map +1 -0
  43. package/dist/text/animations.d.mts +12 -0
  44. package/dist/text/animations.d.ts +12 -0
  45. package/dist/text/animations.js +2 -0
  46. package/dist/text/animations.js.map +1 -0
  47. package/dist/text/index.cjs +3 -0
  48. package/dist/text/index.cjs.map +1 -0
  49. package/dist/text/index.d.mts +10 -0
  50. package/dist/text/index.d.ts +10 -0
  51. package/dist/text/index.js +3 -0
  52. package/dist/text/index.js.map +1 -0
  53. package/dist/types-BuLn_v48.d.mts +59 -0
  54. package/dist/types-BuLn_v48.d.ts +59 -0
  55. package/dist/types-BuzDNWZT.d.mts +62 -0
  56. package/dist/types-BuzDNWZT.d.ts +62 -0
  57. package/dist/types-C3sFNX1j.d.mts +77 -0
  58. package/dist/types-C3sFNX1j.d.ts +77 -0
  59. package/package.json +98 -0
@@ -0,0 +1,59 @@
1
+ import { JSX, CSSProperties, MouseEvent, ReactNode } from 'react';
2
+
3
+ type TextPresetOptions = {
4
+ distance?: number;
5
+ scale?: number;
6
+ blur?: number;
7
+ stagger?: number;
8
+ };
9
+ type AnimationPreset = "fadeSwap" | "morph" | "slideUp" | "slideDown" | "highlight" | "bump" | "blur" | "decoder" | "fadeAway" | "fadeIn" | "fadeOut" | "slideReplace" | "letterDrop" | "glitch" | "textReveal" | "liftReveal" | "scatter" | "typewriter" | "splash" | "jitter" | "popUp" | "jello" | "scramble" | "flip" | "bounce" | "shake" | "pulse" | "blink" | "wave" | "ping" | "popIn" | "dropIn" | "riseUp" | "expandIn" | "shrinkOut" | "boldFlash" | "strikeThrough" | "odometer" | "ticker" | "splitReveal" | "splitSlide" | "bigBang" | "scatterAssemble" | "pixelRain" | "dominoFall" | "vortex" | "pendulum" | "centerBurst" | "gravityBounce" | "scrollFanIn" | "textRotate" | "gooeyMorph" | "randomLetterSwap" | "textEffect" | "staggerText" | "underlineDraw" | "underlineSlide" | "copyConfirm" | "brightnessShift" | "activeTabText" | "fadeOutUp" | "fadeOutDown" | "slideOutUp" | "slideOutDown" | "slideOutLeft" | "slideOutRight" | "scaleOut" | "blurOut" | "clipOut" | "strikeOut" | "typeOut" | "scrambleOut" | "popOut";
10
+ type AnimationTrigger = "change" | "scroll" | "hover" | "click" | "manual" | "mount";
11
+ type AnimationTriggerInput = AnimationTrigger | readonly [AnimationTrigger, AnimationTrigger] | readonly AnimationTrigger[];
12
+ type AnimationProperties = Record<string, readonly [string | number, string | number]>;
13
+ type TriggerConfig = {
14
+ trigger: AnimationTrigger;
15
+ animation: AnimationPreset;
16
+ threshold?: number;
17
+ };
18
+ interface AnimateTextHandle {
19
+ animate: () => void;
20
+ element: HTMLElement | null;
21
+ }
22
+ interface AnimateTextProps {
23
+ value?: string | number;
24
+ triggers?: TriggerConfig[];
25
+ trigger?: AnimationTriggerInput;
26
+ animation: AnimationPreset;
27
+ scrollAnimation?: AnimationPreset;
28
+ properties?: AnimationProperties;
29
+ exitAnimation?: AnimationPreset;
30
+ show?: boolean;
31
+ unmountOnExit?: boolean;
32
+ duration?: number;
33
+ easing?: string;
34
+ delay?: number;
35
+ highlightColor?: string;
36
+ highlightMode?: "persist" | "pulse" | "erase";
37
+ highlightHold?: number;
38
+ threshold?: number;
39
+ repeat?: boolean;
40
+ once?: boolean;
41
+ as?: keyof JSX.IntrinsicElements;
42
+ className?: string;
43
+ style?: CSSProperties;
44
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
45
+ onEnter?: () => void;
46
+ onExit?: () => void;
47
+ onHoverStart?: () => void;
48
+ onHoverEnd?: () => void;
49
+ onAnimationEnd?: () => void;
50
+ presetOptions?: TextPresetOptions;
51
+ children: ReactNode;
52
+ }
53
+ /** Internal shape for each animation preset. */
54
+ interface AnimationDefinition {
55
+ out: Keyframe[];
56
+ in: Keyframe[];
57
+ }
58
+
59
+ export type { AnimateTextHandle as A, AnimateTextProps as a, AnimationDefinition as b, AnimationPreset as c };
@@ -0,0 +1,59 @@
1
+ import { JSX, CSSProperties, MouseEvent, ReactNode } from 'react';
2
+
3
+ type TextPresetOptions = {
4
+ distance?: number;
5
+ scale?: number;
6
+ blur?: number;
7
+ stagger?: number;
8
+ };
9
+ type AnimationPreset = "fadeSwap" | "morph" | "slideUp" | "slideDown" | "highlight" | "bump" | "blur" | "decoder" | "fadeAway" | "fadeIn" | "fadeOut" | "slideReplace" | "letterDrop" | "glitch" | "textReveal" | "liftReveal" | "scatter" | "typewriter" | "splash" | "jitter" | "popUp" | "jello" | "scramble" | "flip" | "bounce" | "shake" | "pulse" | "blink" | "wave" | "ping" | "popIn" | "dropIn" | "riseUp" | "expandIn" | "shrinkOut" | "boldFlash" | "strikeThrough" | "odometer" | "ticker" | "splitReveal" | "splitSlide" | "bigBang" | "scatterAssemble" | "pixelRain" | "dominoFall" | "vortex" | "pendulum" | "centerBurst" | "gravityBounce" | "scrollFanIn" | "textRotate" | "gooeyMorph" | "randomLetterSwap" | "textEffect" | "staggerText" | "underlineDraw" | "underlineSlide" | "copyConfirm" | "brightnessShift" | "activeTabText" | "fadeOutUp" | "fadeOutDown" | "slideOutUp" | "slideOutDown" | "slideOutLeft" | "slideOutRight" | "scaleOut" | "blurOut" | "clipOut" | "strikeOut" | "typeOut" | "scrambleOut" | "popOut";
10
+ type AnimationTrigger = "change" | "scroll" | "hover" | "click" | "manual" | "mount";
11
+ type AnimationTriggerInput = AnimationTrigger | readonly [AnimationTrigger, AnimationTrigger] | readonly AnimationTrigger[];
12
+ type AnimationProperties = Record<string, readonly [string | number, string | number]>;
13
+ type TriggerConfig = {
14
+ trigger: AnimationTrigger;
15
+ animation: AnimationPreset;
16
+ threshold?: number;
17
+ };
18
+ interface AnimateTextHandle {
19
+ animate: () => void;
20
+ element: HTMLElement | null;
21
+ }
22
+ interface AnimateTextProps {
23
+ value?: string | number;
24
+ triggers?: TriggerConfig[];
25
+ trigger?: AnimationTriggerInput;
26
+ animation: AnimationPreset;
27
+ scrollAnimation?: AnimationPreset;
28
+ properties?: AnimationProperties;
29
+ exitAnimation?: AnimationPreset;
30
+ show?: boolean;
31
+ unmountOnExit?: boolean;
32
+ duration?: number;
33
+ easing?: string;
34
+ delay?: number;
35
+ highlightColor?: string;
36
+ highlightMode?: "persist" | "pulse" | "erase";
37
+ highlightHold?: number;
38
+ threshold?: number;
39
+ repeat?: boolean;
40
+ once?: boolean;
41
+ as?: keyof JSX.IntrinsicElements;
42
+ className?: string;
43
+ style?: CSSProperties;
44
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
45
+ onEnter?: () => void;
46
+ onExit?: () => void;
47
+ onHoverStart?: () => void;
48
+ onHoverEnd?: () => void;
49
+ onAnimationEnd?: () => void;
50
+ presetOptions?: TextPresetOptions;
51
+ children: ReactNode;
52
+ }
53
+ /** Internal shape for each animation preset. */
54
+ interface AnimationDefinition {
55
+ out: Keyframe[];
56
+ in: Keyframe[];
57
+ }
58
+
59
+ export type { AnimateTextHandle as A, AnimateTextProps as a, AnimationDefinition as b, AnimationPreset as c };
@@ -0,0 +1,62 @@
1
+ import { JSX, CSSProperties, ReactNode } from 'react';
2
+
3
+ type ListPresetOptions = {
4
+ distance?: number;
5
+ scale?: number;
6
+ blur?: number;
7
+ stagger?: number;
8
+ };
9
+ type ListTrigger = "scroll" | "hover" | "click" | "mount" | "manual";
10
+ type ListTriggerInput = ListTrigger | readonly [ListTrigger, ListTrigger] | readonly ListTrigger[];
11
+ type ListReorderPreset = "flip" | "smooth" | "spring" | "none";
12
+ type AnimationProperties = Record<string, readonly [string | number, string | number]>;
13
+ type ListTriggerConfig = {
14
+ trigger: ListTrigger;
15
+ animation: ListAnimationPreset;
16
+ threshold?: number;
17
+ };
18
+ type ListStaggerPreset = "staggerFadeIn" | "staggerSlideUp" | "staggerSlideLeft" | "staggerZoomIn" | "staggerPopIn" | "stackIn";
19
+ type ListCascadePreset = "wordCascade" | "wordWave" | "wordDrop" | "wordFadeIn";
20
+ type ListMarqueePreset = "marquee" | "marqueeReverse" | "marqueeFade";
21
+ type ListParallaxPreset = "parallax" | "parallaxFast" | "parallaxReverse" | "tiltScroll" | "scaleScroll" | "parallaxStagger";
22
+ type ListPresencePreset = "itemFadeIn" | "itemSlideIn" | "itemPopIn" | "itemBounceIn" | "itemFadeOut" | "itemSlideOut" | "itemCollapseOut";
23
+ type ListAnimationPreset = ListStaggerPreset | ListCascadePreset | ListMarqueePreset | ListParallaxPreset | ListPresencePreset | ListReorderPreset | "fadeIn" | "slideIn" | "slideInLeft" | "slideInRight" | "popIn" | "bounceIn" | "expandIn" | "flipIn" | "glideIn" | "fadeOut" | "slideOut" | "slideOutLeft" | "slideOutRight" | "popOut" | "bounceOut" | "collapseOut" | "flipOut" | "glideOut" | "itemSlideOutLeft" | "itemSlideOutRight" | "itemScaleOut" | "itemPopOut" | "itemBlurOut" | "itemDismissOut" | "rowCollapseOut" | "tagRemove" | "cardRemove" | "marquee" | "staggerBlurIn" | "feedAppend" | "filterIn" | "emptyToList" | "selectionPulse" | "insertItem" | "emptyStateToList";
24
+ interface AnimationDefinition {
25
+ keyframes: Keyframe[];
26
+ options?: globalThis.KeyframeAnimationOptions;
27
+ }
28
+ interface AnimateListProps {
29
+ triggers?: ListTriggerConfig[];
30
+ animation?: ListAnimationPreset;
31
+ scrollAnimation?: ListAnimationPreset;
32
+ properties?: AnimationProperties;
33
+ exitAnimation?: ListAnimationPreset;
34
+ reorderAnimation?: ListAnimationPreset;
35
+ reorder?: ListReorderPreset;
36
+ duration?: number;
37
+ reorderDuration?: number;
38
+ stagger?: number;
39
+ exitStagger?: number;
40
+ speed?: number;
41
+ trigger?: ListTriggerInput;
42
+ threshold?: number;
43
+ easing?: string;
44
+ reorderEasing?: string;
45
+ as?: keyof JSX.IntrinsicElements;
46
+ className?: string;
47
+ style?: CSSProperties;
48
+ onItemEnter?: (key: string | number) => void;
49
+ onItemExit?: (key: string | number) => void;
50
+ onReorder?: () => void;
51
+ presetOptions?: ListPresetOptions;
52
+ children: ReactNode;
53
+ customAnimation?: {
54
+ enter?: AnimationDefinition;
55
+ exit?: AnimationDefinition;
56
+ };
57
+ }
58
+ interface AnimateListHandle {
59
+ animate: () => void;
60
+ }
61
+
62
+ export type { AnimateListHandle as A, ListAnimationPreset as L, AnimateListProps as a, AnimationDefinition as b };
@@ -0,0 +1,62 @@
1
+ import { JSX, CSSProperties, ReactNode } from 'react';
2
+
3
+ type ListPresetOptions = {
4
+ distance?: number;
5
+ scale?: number;
6
+ blur?: number;
7
+ stagger?: number;
8
+ };
9
+ type ListTrigger = "scroll" | "hover" | "click" | "mount" | "manual";
10
+ type ListTriggerInput = ListTrigger | readonly [ListTrigger, ListTrigger] | readonly ListTrigger[];
11
+ type ListReorderPreset = "flip" | "smooth" | "spring" | "none";
12
+ type AnimationProperties = Record<string, readonly [string | number, string | number]>;
13
+ type ListTriggerConfig = {
14
+ trigger: ListTrigger;
15
+ animation: ListAnimationPreset;
16
+ threshold?: number;
17
+ };
18
+ type ListStaggerPreset = "staggerFadeIn" | "staggerSlideUp" | "staggerSlideLeft" | "staggerZoomIn" | "staggerPopIn" | "stackIn";
19
+ type ListCascadePreset = "wordCascade" | "wordWave" | "wordDrop" | "wordFadeIn";
20
+ type ListMarqueePreset = "marquee" | "marqueeReverse" | "marqueeFade";
21
+ type ListParallaxPreset = "parallax" | "parallaxFast" | "parallaxReverse" | "tiltScroll" | "scaleScroll" | "parallaxStagger";
22
+ type ListPresencePreset = "itemFadeIn" | "itemSlideIn" | "itemPopIn" | "itemBounceIn" | "itemFadeOut" | "itemSlideOut" | "itemCollapseOut";
23
+ type ListAnimationPreset = ListStaggerPreset | ListCascadePreset | ListMarqueePreset | ListParallaxPreset | ListPresencePreset | ListReorderPreset | "fadeIn" | "slideIn" | "slideInLeft" | "slideInRight" | "popIn" | "bounceIn" | "expandIn" | "flipIn" | "glideIn" | "fadeOut" | "slideOut" | "slideOutLeft" | "slideOutRight" | "popOut" | "bounceOut" | "collapseOut" | "flipOut" | "glideOut" | "itemSlideOutLeft" | "itemSlideOutRight" | "itemScaleOut" | "itemPopOut" | "itemBlurOut" | "itemDismissOut" | "rowCollapseOut" | "tagRemove" | "cardRemove" | "marquee" | "staggerBlurIn" | "feedAppend" | "filterIn" | "emptyToList" | "selectionPulse" | "insertItem" | "emptyStateToList";
24
+ interface AnimationDefinition {
25
+ keyframes: Keyframe[];
26
+ options?: globalThis.KeyframeAnimationOptions;
27
+ }
28
+ interface AnimateListProps {
29
+ triggers?: ListTriggerConfig[];
30
+ animation?: ListAnimationPreset;
31
+ scrollAnimation?: ListAnimationPreset;
32
+ properties?: AnimationProperties;
33
+ exitAnimation?: ListAnimationPreset;
34
+ reorderAnimation?: ListAnimationPreset;
35
+ reorder?: ListReorderPreset;
36
+ duration?: number;
37
+ reorderDuration?: number;
38
+ stagger?: number;
39
+ exitStagger?: number;
40
+ speed?: number;
41
+ trigger?: ListTriggerInput;
42
+ threshold?: number;
43
+ easing?: string;
44
+ reorderEasing?: string;
45
+ as?: keyof JSX.IntrinsicElements;
46
+ className?: string;
47
+ style?: CSSProperties;
48
+ onItemEnter?: (key: string | number) => void;
49
+ onItemExit?: (key: string | number) => void;
50
+ onReorder?: () => void;
51
+ presetOptions?: ListPresetOptions;
52
+ children: ReactNode;
53
+ customAnimation?: {
54
+ enter?: AnimationDefinition;
55
+ exit?: AnimationDefinition;
56
+ };
57
+ }
58
+ interface AnimateListHandle {
59
+ animate: () => void;
60
+ }
61
+
62
+ export type { AnimateListHandle as A, ListAnimationPreset as L, AnimateListProps as a, AnimationDefinition as b };
@@ -0,0 +1,77 @@
1
+ import { JSX, CSSProperties, MouseEvent, ReactNode } from 'react';
2
+
3
+ type BlockPresetOptions = {
4
+ distance?: number;
5
+ scale?: number;
6
+ blur?: number;
7
+ rotate?: number;
8
+ };
9
+ type PresetCategory = "oneshot" | "continuous" | "hoverState" | "cursorTrack" | "scrollLink" | "overlay";
10
+ type BlockAnimationPreset = "fadeIn" | "fadeOut" | "fadeSwap" | "slideUp" | "slideDown" | "slideLeft" | "slideRight" | "scaleIn" | "scaleOut" | "popIn" | "popOut" | "rotateIn" | "rotateOut" | "flipX" | "flipY" | "bounceIn" | "bounceOut" | "shake" | "pulse" | "wiggle" | "jello" | "flash" | "heartBeat" | "glideIn" | "glideOut" | "dropIn" | "riseUp" | "expandIn" | "collapseOut" | "expandHeight" | "fadeSlideUp" | "blurIn" | "blurOut" | "clipUp" | "clipLeft" | "zoomIn" | "zoomOut" | "springBounce" | "springScale" | "springSlideUp" | "springSlideDown" | "morphRadius" | "morphCircle" | "parallax" | "parallaxFast" | "parallaxReverse" | "tiltScroll" | "scaleScroll" | "lift" | "sink" | "grow" | "glow" | "shadow" | "borderPop" | "tilt" | "float" | "press" | "ripple" | "burst" | "spin" | "ping" | "shimmer" | "tilt3D" | "rotate3D" | "depth" | "modalIn" | "modalOut" | "popoverIn" | "popoverOut" | "toastIn" | "toastOut" | "successCheckIn" | "buttonLoading" | "focusRingPulse" | "tabPanelIn" | "tabPanelOut" | "successToast" | "checkboxCheck" | "dialogOut" | "drawerOutLeft" | "drawerOutRight" | "drawerOutTop" | "drawerOutBottom" | "menuOut" | "toastOutRight" | "toastOutUp" | "collapseWidth" | "dismissOut" | "errorOut" | "successOut";
11
+ type AnimationTrigger = "change" | "scroll" | "hover" | "click" | "manual" | "mount";
12
+ type AnimationTriggerInput = AnimationTrigger | readonly [AnimationTrigger, AnimationTrigger] | readonly AnimationTrigger[];
13
+ type AnimationProperties = Record<string, readonly [string | number, string | number]>;
14
+ type TriggerConfig = {
15
+ trigger: AnimationTrigger;
16
+ animation: BlockAnimationPreset;
17
+ threshold?: number;
18
+ };
19
+ interface AnimateBlockHandle {
20
+ animate: () => void;
21
+ element: HTMLElement | null;
22
+ }
23
+ interface AnimateBlockProps {
24
+ value?: string | number;
25
+ triggers?: TriggerConfig[];
26
+ trigger?: AnimationTriggerInput;
27
+ animation: BlockAnimationPreset;
28
+ scrollAnimation?: BlockAnimationPreset;
29
+ properties?: AnimationProperties;
30
+ exitAnimation?: BlockAnimationPreset;
31
+ show?: boolean;
32
+ unmountOnExit?: boolean;
33
+ duration?: number;
34
+ easing?: string;
35
+ delay?: number;
36
+ speed?: number;
37
+ threshold?: number;
38
+ repeat?: boolean;
39
+ once?: boolean;
40
+ as?: keyof JSX.IntrinsicElements;
41
+ className?: string;
42
+ style?: CSSProperties;
43
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
44
+ onEnter?: () => void;
45
+ onExit?: () => void;
46
+ onHoverStart?: () => void;
47
+ onHoverEnd?: () => void;
48
+ onAnimationEnd?: () => void;
49
+ presetOptions?: BlockPresetOptions;
50
+ drag?: "x" | "y" | "both" | boolean;
51
+ dragThreshold?: number;
52
+ dragElastic?: number;
53
+ dragSnapBackDuration?: number;
54
+ onDragEnd?: (info: {
55
+ offset: {
56
+ x: number;
57
+ y: number;
58
+ };
59
+ velocity: {
60
+ x: number;
61
+ y: number;
62
+ };
63
+ dismissed: boolean;
64
+ }) => void;
65
+ layoutId?: string;
66
+ layoutTransition?: {
67
+ duration?: number;
68
+ easing?: string;
69
+ };
70
+ children: ReactNode;
71
+ }
72
+ interface AnimationDefinition {
73
+ in: Keyframe[];
74
+ out: Keyframe[];
75
+ }
76
+
77
+ export type { AnimateBlockHandle as A, PresetCategory as P, AnimateBlockProps as a, AnimationDefinition as b };
@@ -0,0 +1,77 @@
1
+ import { JSX, CSSProperties, MouseEvent, ReactNode } from 'react';
2
+
3
+ type BlockPresetOptions = {
4
+ distance?: number;
5
+ scale?: number;
6
+ blur?: number;
7
+ rotate?: number;
8
+ };
9
+ type PresetCategory = "oneshot" | "continuous" | "hoverState" | "cursorTrack" | "scrollLink" | "overlay";
10
+ type BlockAnimationPreset = "fadeIn" | "fadeOut" | "fadeSwap" | "slideUp" | "slideDown" | "slideLeft" | "slideRight" | "scaleIn" | "scaleOut" | "popIn" | "popOut" | "rotateIn" | "rotateOut" | "flipX" | "flipY" | "bounceIn" | "bounceOut" | "shake" | "pulse" | "wiggle" | "jello" | "flash" | "heartBeat" | "glideIn" | "glideOut" | "dropIn" | "riseUp" | "expandIn" | "collapseOut" | "expandHeight" | "fadeSlideUp" | "blurIn" | "blurOut" | "clipUp" | "clipLeft" | "zoomIn" | "zoomOut" | "springBounce" | "springScale" | "springSlideUp" | "springSlideDown" | "morphRadius" | "morphCircle" | "parallax" | "parallaxFast" | "parallaxReverse" | "tiltScroll" | "scaleScroll" | "lift" | "sink" | "grow" | "glow" | "shadow" | "borderPop" | "tilt" | "float" | "press" | "ripple" | "burst" | "spin" | "ping" | "shimmer" | "tilt3D" | "rotate3D" | "depth" | "modalIn" | "modalOut" | "popoverIn" | "popoverOut" | "toastIn" | "toastOut" | "successCheckIn" | "buttonLoading" | "focusRingPulse" | "tabPanelIn" | "tabPanelOut" | "successToast" | "checkboxCheck" | "dialogOut" | "drawerOutLeft" | "drawerOutRight" | "drawerOutTop" | "drawerOutBottom" | "menuOut" | "toastOutRight" | "toastOutUp" | "collapseWidth" | "dismissOut" | "errorOut" | "successOut";
11
+ type AnimationTrigger = "change" | "scroll" | "hover" | "click" | "manual" | "mount";
12
+ type AnimationTriggerInput = AnimationTrigger | readonly [AnimationTrigger, AnimationTrigger] | readonly AnimationTrigger[];
13
+ type AnimationProperties = Record<string, readonly [string | number, string | number]>;
14
+ type TriggerConfig = {
15
+ trigger: AnimationTrigger;
16
+ animation: BlockAnimationPreset;
17
+ threshold?: number;
18
+ };
19
+ interface AnimateBlockHandle {
20
+ animate: () => void;
21
+ element: HTMLElement | null;
22
+ }
23
+ interface AnimateBlockProps {
24
+ value?: string | number;
25
+ triggers?: TriggerConfig[];
26
+ trigger?: AnimationTriggerInput;
27
+ animation: BlockAnimationPreset;
28
+ scrollAnimation?: BlockAnimationPreset;
29
+ properties?: AnimationProperties;
30
+ exitAnimation?: BlockAnimationPreset;
31
+ show?: boolean;
32
+ unmountOnExit?: boolean;
33
+ duration?: number;
34
+ easing?: string;
35
+ delay?: number;
36
+ speed?: number;
37
+ threshold?: number;
38
+ repeat?: boolean;
39
+ once?: boolean;
40
+ as?: keyof JSX.IntrinsicElements;
41
+ className?: string;
42
+ style?: CSSProperties;
43
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
44
+ onEnter?: () => void;
45
+ onExit?: () => void;
46
+ onHoverStart?: () => void;
47
+ onHoverEnd?: () => void;
48
+ onAnimationEnd?: () => void;
49
+ presetOptions?: BlockPresetOptions;
50
+ drag?: "x" | "y" | "both" | boolean;
51
+ dragThreshold?: number;
52
+ dragElastic?: number;
53
+ dragSnapBackDuration?: number;
54
+ onDragEnd?: (info: {
55
+ offset: {
56
+ x: number;
57
+ y: number;
58
+ };
59
+ velocity: {
60
+ x: number;
61
+ y: number;
62
+ };
63
+ dismissed: boolean;
64
+ }) => void;
65
+ layoutId?: string;
66
+ layoutTransition?: {
67
+ duration?: number;
68
+ easing?: string;
69
+ };
70
+ children: ReactNode;
71
+ }
72
+ interface AnimationDefinition {
73
+ in: Keyframe[];
74
+ out: Keyframe[];
75
+ }
76
+
77
+ export type { AnimateBlockHandle as A, PresetCategory as P, AnimateBlockProps as a, AnimationDefinition as b };
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "@emekaugbanu/trigr",
3
+ "version": "0.4.0",
4
+ "description": "Content-aware animation library for React. One import per content type. One prop to trigger.",
5
+ "license": "MIT",
6
+ "author": "Emeka Ugbanu",
7
+ "homepage": "https://emeka-ugbanu-hub.github.io/Trigr",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Emeka-Ugbanu-hub/Trigr.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/Emeka-Ugbanu-hub/Trigr/issues"
14
+ },
15
+ "keywords": [
16
+ "react",
17
+ "animation",
18
+ "transitions",
19
+ "wrapper",
20
+ "trigr"
21
+ ],
22
+ "sideEffects": false,
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "main": "./dist/text/index.cjs",
29
+ "module": "./dist/text/index.js",
30
+ "types": "./dist/text/index.d.ts",
31
+ "exports": {
32
+ "./text": {
33
+ "types": "./dist/text/index.d.ts",
34
+ "import": "./dist/text/index.js",
35
+ "require": "./dist/text/index.cjs"
36
+ },
37
+ "./text/keyframes": {
38
+ "types": "./dist/text/animations.d.ts",
39
+ "import": "./dist/text/animations.js",
40
+ "require": "./dist/text/animations.cjs"
41
+ },
42
+ "./paragraph": {
43
+ "types": "./dist/paragraph/index.d.ts",
44
+ "import": "./dist/paragraph/index.js",
45
+ "require": "./dist/paragraph/index.cjs"
46
+ },
47
+ "./paragraph/keyframes": {
48
+ "types": "./dist/paragraph/animations.d.ts",
49
+ "import": "./dist/paragraph/animations.js",
50
+ "require": "./dist/paragraph/animations.cjs"
51
+ },
52
+ "./list": {
53
+ "types": "./dist/list/index.d.ts",
54
+ "import": "./dist/list/index.js",
55
+ "require": "./dist/list/index.cjs"
56
+ },
57
+ "./list/keyframes": {
58
+ "types": "./dist/list/animations.d.ts",
59
+ "import": "./dist/list/animations.js",
60
+ "require": "./dist/list/animations.cjs"
61
+ },
62
+ "./block": {
63
+ "types": "./dist/block/index.d.ts",
64
+ "import": "./dist/block/index.js",
65
+ "require": "./dist/block/index.cjs"
66
+ },
67
+ "./block/keyframes": {
68
+ "types": "./dist/block/animations.d.ts",
69
+ "import": "./dist/block/animations.js",
70
+ "require": "./dist/block/animations.cjs"
71
+ }
72
+ },
73
+ "scripts": {
74
+ "build": "tsup",
75
+ "dev": "tsup --watch",
76
+ "typecheck": "tsc --noEmit",
77
+ "playground": "vite --config playground/vite.config.ts playground",
78
+ "site:build": "vite build --config playground/vite.config.ts playground",
79
+ "site:preview": "vite preview --config playground/vite.config.ts playground",
80
+ "deploy": "npm run site:build && bash deploy.sh",
81
+ "pack:dry": "npm pack --dry-run",
82
+ "prepublishOnly": "npm run typecheck && npm run build"
83
+ },
84
+ "peerDependencies": {
85
+ "react": ">=18.0.0",
86
+ "react-dom": ">=18.0.0"
87
+ },
88
+ "devDependencies": {
89
+ "@types/node": "^25.8.0",
90
+ "@types/react": "^19.2.14",
91
+ "@vitejs/plugin-react": "^4.7.0",
92
+ "react": "^19.2.6",
93
+ "react-dom": "^19.2.6",
94
+ "tsup": "^8.4.0",
95
+ "typescript": "^6.0.3",
96
+ "vite": "^6.4.2"
97
+ }
98
+ }