ink-motion 0.1.0 → 1.0.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.cts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
3
  /**
4
4
  * Colour value as hex (#ff0000), rgb (rgb(255,0,0)), or named (red, blue, etc.)
@@ -43,6 +43,93 @@ interface BaseEffectProps {
43
43
  onComplete?: () => void;
44
44
  }
45
45
 
46
+ interface FadeProps extends BaseEffectProps {
47
+ /**
48
+ * Text colour
49
+ * @default '#ffffff'
50
+ * @example 'yellow'
51
+ */
52
+ color?: Colour;
53
+ /**
54
+ * Starting opacity (0-1)
55
+ * @default 0
56
+ */
57
+ from?: number;
58
+ /**
59
+ * Ending opacity (0-1)
60
+ * @default 1
61
+ */
62
+ to?: number;
63
+ /**
64
+ * Duration in milliseconds
65
+ * @default 1000
66
+ */
67
+ duration?: number;
68
+ /**
69
+ * Easing function
70
+ * @default 'ease-out'
71
+ */
72
+ easing?: EasingName;
73
+ /**
74
+ * Loop animation continuously
75
+ * @default false
76
+ */
77
+ loop?: boolean;
78
+ }
79
+ /**
80
+ * Fade effect component that smoothly transitions text opacity
81
+ *
82
+ * Animates text from one opacity to another using configurable easing functions.
83
+ * Can loop continuously or run once.
84
+ *
85
+ * @example
86
+ * ```tsx
87
+ * <Fade color="yellow" from={0} to={1} duration={500} easing="ease-in">
88
+ * Success!
89
+ * </Fade>
90
+ * ```
91
+ */
92
+ declare function Fade({ children, color, from, to, duration, easing, loop, speed, enabled, onComplete, }: FadeProps): react_jsx_runtime.JSX.Element;
93
+
94
+ interface FlashProps extends BaseEffectProps {
95
+ /**
96
+ * Text colour
97
+ * @default '#ffffff'
98
+ * @example 'cyan'
99
+ */
100
+ color?: Colour;
101
+ /**
102
+ * Minimum brightness (0-1)
103
+ * @default 0.3
104
+ */
105
+ minIntensity?: number;
106
+ /**
107
+ * Maximum brightness (0-1)
108
+ * @default 1
109
+ */
110
+ maxIntensity?: number;
111
+ /**
112
+ * Flash cycle duration in milliseconds
113
+ * @default 1000
114
+ */
115
+ duration?: number;
116
+ }
117
+ /**
118
+ * Flash effect component that creates a pulsing neon-like glow
119
+ *
120
+ * Animates text with a continuous brightness pulse that oscillates
121
+ * between minimum and maximum intensity levels, creating a flashing
122
+ * or glowing neon effect.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * <Flash color="cyan" minIntensity={0.3} maxIntensity={1} duration={800}>
127
+ * ⚡ NEON GLOW ⚡
128
+ * </Flash>
129
+ * ```
130
+ */
131
+ declare function Flash({ children, color, minIntensity, maxIntensity, duration, speed, enabled, }: FlashProps): react_jsx_runtime.JSX.Element;
132
+
46
133
  type ShimmerDirection = 'left' | 'right';
47
134
  interface ShimmerProps extends BaseEffectProps {
48
135
  /**
@@ -80,7 +167,7 @@ interface ShimmerProps extends BaseEffectProps {
80
167
  * </Shimmer>
81
168
  * ```
82
169
  */
83
- declare function Shimmer({ children, colors, width, intensity, direction, speed, enabled, onComplete, }: ShimmerProps): React.JSX.Element;
170
+ declare function Shimmer({ children, colors, width, intensity, direction, speed, enabled, onComplete, }: ShimmerProps): react_jsx_runtime.JSX.Element;
84
171
 
85
172
  interface TypewriterProps extends BaseEffectProps {
86
173
  /**
@@ -125,55 +212,7 @@ interface TypewriterProps extends BaseEffectProps {
125
212
  * </Typewriter>
126
213
  * ```
127
214
  */
128
- declare function Typewriter({ children, color, cursor, cursorColor, variance, delay, speed, enabled, onComplete, }: TypewriterProps): React.JSX.Element;
129
-
130
- interface FadeProps extends BaseEffectProps {
131
- /**
132
- * Text colour
133
- * @default '#ffffff'
134
- * @example 'yellow'
135
- */
136
- color?: Colour;
137
- /**
138
- * Starting opacity (0-1)
139
- * @default 0
140
- */
141
- from?: number;
142
- /**
143
- * Ending opacity (0-1)
144
- * @default 1
145
- */
146
- to?: number;
147
- /**
148
- * Duration in milliseconds
149
- * @default 1000
150
- */
151
- duration?: number;
152
- /**
153
- * Easing function
154
- * @default 'ease-out'
155
- */
156
- easing?: EasingName;
157
- /**
158
- * Loop animation continuously
159
- * @default false
160
- */
161
- loop?: boolean;
162
- }
163
- /**
164
- * Fade effect component that smoothly transitions text opacity
165
- *
166
- * Animates text from one opacity to another using configurable easing functions.
167
- * Can loop continuously or run once.
168
- *
169
- * @example
170
- * ```tsx
171
- * <Fade color="yellow" from={0} to={1} duration={500} easing="ease-in">
172
- * Success!
173
- * </Fade>
174
- * ```
175
- */
176
- declare function Fade({ children, color, from, to, duration, easing, loop, speed, enabled, onComplete, }: FadeProps): React.JSX.Element;
215
+ declare function Typewriter({ children, color, cursor, cursorColor, variance, delay, speed, enabled, onComplete, }: TypewriterProps): react_jsx_runtime.JSX.Element;
177
216
 
178
217
  type WaveType = 'brightness' | 'vertical';
179
218
  interface WaveProps extends BaseEffectProps {
@@ -212,7 +251,7 @@ interface WaveProps extends BaseEffectProps {
212
251
  * </Wave>
213
252
  * ```
214
253
  */
215
- declare function Wave({ children, colors, amplitude, frequency, type, speed, enabled, }: WaveProps): React.JSX.Element;
254
+ declare function Wave({ children, colors, amplitude, frequency, type, speed, enabled, }: WaveProps): react_jsx_runtime.JSX.Element;
216
255
 
217
256
  /**
218
257
  * Runs a callback on every animation frame using setInterval
@@ -222,15 +261,6 @@ declare function Wave({ children, colors, amplitude, frequency, type, speed, ena
222
261
  */
223
262
  declare function useAnimationFrame(callback: (deltaTime: number) => void, enabled?: boolean): void;
224
263
 
225
- /**
226
- * Hook that tracks elapsed time since mount or last reset
227
- *
228
- * @param enabled - Whether to track time
229
- * @param speed - Speed multiplier (default: 1)
230
- * @returns Elapsed time in milliseconds
231
- */
232
- declare function useElapsedTime(enabled?: boolean, speed?: number): number;
233
-
234
264
  interface UseCursorBlinkOptions {
235
265
  enabled: boolean;
236
266
  isComplete: boolean;
@@ -239,10 +269,21 @@ interface UseCursorBlinkOptions {
239
269
  * Hook that manages cursor blinking state
240
270
  *
241
271
  * @param options - Configuration for cursor blink
272
+ * @param options.enabled - Whether cursor blinking is enabled
273
+ * @param options.isComplete - Whether typing is complete
242
274
  * @returns Whether cursor should be visible
243
275
  */
244
276
  declare function useCursorBlink({ enabled, isComplete, }: UseCursorBlinkOptions): boolean;
245
277
 
278
+ /**
279
+ * Hook that tracks elapsed time since mount or last reset
280
+ *
281
+ * @param enabled - Whether to track time
282
+ * @param speed - Speed multiplier (default: 1)
283
+ * @returns Elapsed time in milliseconds
284
+ */
285
+ declare function useElapsedTime(enabled?: boolean, speed?: number): number;
286
+
246
287
  interface UseTypewriterProgressOptions {
247
288
  totalCharacters: number;
248
289
  speed: number;
@@ -255,8 +296,14 @@ interface UseTypewriterProgressOptions {
255
296
  * Hook that manages typewriter character reveal timing
256
297
  *
257
298
  * @param options - Configuration for typewriter progress
299
+ * @param options.totalCharacters - Total number of characters to reveal
300
+ * @param options.speed - Animation speed multiplier
301
+ * @param options.variance - Typing variance for human-like timing (0-1)
302
+ * @param options.initialDelay - Delay before typing starts in milliseconds
303
+ * @param options.enabled - Whether the animation is enabled
304
+ * @param options.onComplete - Callback when typing completes
258
305
  * @returns Number of characters to display
259
306
  */
260
307
  declare function useTypewriterProgress({ totalCharacters, speed, variance, initialDelay, enabled, onComplete, }: UseTypewriterProgressOptions): number;
261
308
 
262
- export { type BaseEffectProps, type Color, type Colour, type EasingFunction, type EasingName, Fade, Shimmer, Typewriter, Wave, useAnimationFrame, useCursorBlink, useElapsedTime, useTypewriterProgress };
309
+ export { type BaseEffectProps, type Color, type Colour, type EasingFunction, type EasingName, Fade, Flash, Shimmer, Typewriter, Wave, useAnimationFrame, useCursorBlink, useElapsedTime, useTypewriterProgress };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
3
  /**
4
4
  * Colour value as hex (#ff0000), rgb (rgb(255,0,0)), or named (red, blue, etc.)
@@ -43,6 +43,93 @@ interface BaseEffectProps {
43
43
  onComplete?: () => void;
44
44
  }
45
45
 
46
+ interface FadeProps extends BaseEffectProps {
47
+ /**
48
+ * Text colour
49
+ * @default '#ffffff'
50
+ * @example 'yellow'
51
+ */
52
+ color?: Colour;
53
+ /**
54
+ * Starting opacity (0-1)
55
+ * @default 0
56
+ */
57
+ from?: number;
58
+ /**
59
+ * Ending opacity (0-1)
60
+ * @default 1
61
+ */
62
+ to?: number;
63
+ /**
64
+ * Duration in milliseconds
65
+ * @default 1000
66
+ */
67
+ duration?: number;
68
+ /**
69
+ * Easing function
70
+ * @default 'ease-out'
71
+ */
72
+ easing?: EasingName;
73
+ /**
74
+ * Loop animation continuously
75
+ * @default false
76
+ */
77
+ loop?: boolean;
78
+ }
79
+ /**
80
+ * Fade effect component that smoothly transitions text opacity
81
+ *
82
+ * Animates text from one opacity to another using configurable easing functions.
83
+ * Can loop continuously or run once.
84
+ *
85
+ * @example
86
+ * ```tsx
87
+ * <Fade color="yellow" from={0} to={1} duration={500} easing="ease-in">
88
+ * Success!
89
+ * </Fade>
90
+ * ```
91
+ */
92
+ declare function Fade({ children, color, from, to, duration, easing, loop, speed, enabled, onComplete, }: FadeProps): react_jsx_runtime.JSX.Element;
93
+
94
+ interface FlashProps extends BaseEffectProps {
95
+ /**
96
+ * Text colour
97
+ * @default '#ffffff'
98
+ * @example 'cyan'
99
+ */
100
+ color?: Colour;
101
+ /**
102
+ * Minimum brightness (0-1)
103
+ * @default 0.3
104
+ */
105
+ minIntensity?: number;
106
+ /**
107
+ * Maximum brightness (0-1)
108
+ * @default 1
109
+ */
110
+ maxIntensity?: number;
111
+ /**
112
+ * Flash cycle duration in milliseconds
113
+ * @default 1000
114
+ */
115
+ duration?: number;
116
+ }
117
+ /**
118
+ * Flash effect component that creates a pulsing neon-like glow
119
+ *
120
+ * Animates text with a continuous brightness pulse that oscillates
121
+ * between minimum and maximum intensity levels, creating a flashing
122
+ * or glowing neon effect.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * <Flash color="cyan" minIntensity={0.3} maxIntensity={1} duration={800}>
127
+ * ⚡ NEON GLOW ⚡
128
+ * </Flash>
129
+ * ```
130
+ */
131
+ declare function Flash({ children, color, minIntensity, maxIntensity, duration, speed, enabled, }: FlashProps): react_jsx_runtime.JSX.Element;
132
+
46
133
  type ShimmerDirection = 'left' | 'right';
47
134
  interface ShimmerProps extends BaseEffectProps {
48
135
  /**
@@ -80,7 +167,7 @@ interface ShimmerProps extends BaseEffectProps {
80
167
  * </Shimmer>
81
168
  * ```
82
169
  */
83
- declare function Shimmer({ children, colors, width, intensity, direction, speed, enabled, onComplete, }: ShimmerProps): React.JSX.Element;
170
+ declare function Shimmer({ children, colors, width, intensity, direction, speed, enabled, onComplete, }: ShimmerProps): react_jsx_runtime.JSX.Element;
84
171
 
85
172
  interface TypewriterProps extends BaseEffectProps {
86
173
  /**
@@ -125,55 +212,7 @@ interface TypewriterProps extends BaseEffectProps {
125
212
  * </Typewriter>
126
213
  * ```
127
214
  */
128
- declare function Typewriter({ children, color, cursor, cursorColor, variance, delay, speed, enabled, onComplete, }: TypewriterProps): React.JSX.Element;
129
-
130
- interface FadeProps extends BaseEffectProps {
131
- /**
132
- * Text colour
133
- * @default '#ffffff'
134
- * @example 'yellow'
135
- */
136
- color?: Colour;
137
- /**
138
- * Starting opacity (0-1)
139
- * @default 0
140
- */
141
- from?: number;
142
- /**
143
- * Ending opacity (0-1)
144
- * @default 1
145
- */
146
- to?: number;
147
- /**
148
- * Duration in milliseconds
149
- * @default 1000
150
- */
151
- duration?: number;
152
- /**
153
- * Easing function
154
- * @default 'ease-out'
155
- */
156
- easing?: EasingName;
157
- /**
158
- * Loop animation continuously
159
- * @default false
160
- */
161
- loop?: boolean;
162
- }
163
- /**
164
- * Fade effect component that smoothly transitions text opacity
165
- *
166
- * Animates text from one opacity to another using configurable easing functions.
167
- * Can loop continuously or run once.
168
- *
169
- * @example
170
- * ```tsx
171
- * <Fade color="yellow" from={0} to={1} duration={500} easing="ease-in">
172
- * Success!
173
- * </Fade>
174
- * ```
175
- */
176
- declare function Fade({ children, color, from, to, duration, easing, loop, speed, enabled, onComplete, }: FadeProps): React.JSX.Element;
215
+ declare function Typewriter({ children, color, cursor, cursorColor, variance, delay, speed, enabled, onComplete, }: TypewriterProps): react_jsx_runtime.JSX.Element;
177
216
 
178
217
  type WaveType = 'brightness' | 'vertical';
179
218
  interface WaveProps extends BaseEffectProps {
@@ -212,7 +251,7 @@ interface WaveProps extends BaseEffectProps {
212
251
  * </Wave>
213
252
  * ```
214
253
  */
215
- declare function Wave({ children, colors, amplitude, frequency, type, speed, enabled, }: WaveProps): React.JSX.Element;
254
+ declare function Wave({ children, colors, amplitude, frequency, type, speed, enabled, }: WaveProps): react_jsx_runtime.JSX.Element;
216
255
 
217
256
  /**
218
257
  * Runs a callback on every animation frame using setInterval
@@ -222,15 +261,6 @@ declare function Wave({ children, colors, amplitude, frequency, type, speed, ena
222
261
  */
223
262
  declare function useAnimationFrame(callback: (deltaTime: number) => void, enabled?: boolean): void;
224
263
 
225
- /**
226
- * Hook that tracks elapsed time since mount or last reset
227
- *
228
- * @param enabled - Whether to track time
229
- * @param speed - Speed multiplier (default: 1)
230
- * @returns Elapsed time in milliseconds
231
- */
232
- declare function useElapsedTime(enabled?: boolean, speed?: number): number;
233
-
234
264
  interface UseCursorBlinkOptions {
235
265
  enabled: boolean;
236
266
  isComplete: boolean;
@@ -239,10 +269,21 @@ interface UseCursorBlinkOptions {
239
269
  * Hook that manages cursor blinking state
240
270
  *
241
271
  * @param options - Configuration for cursor blink
272
+ * @param options.enabled - Whether cursor blinking is enabled
273
+ * @param options.isComplete - Whether typing is complete
242
274
  * @returns Whether cursor should be visible
243
275
  */
244
276
  declare function useCursorBlink({ enabled, isComplete, }: UseCursorBlinkOptions): boolean;
245
277
 
278
+ /**
279
+ * Hook that tracks elapsed time since mount or last reset
280
+ *
281
+ * @param enabled - Whether to track time
282
+ * @param speed - Speed multiplier (default: 1)
283
+ * @returns Elapsed time in milliseconds
284
+ */
285
+ declare function useElapsedTime(enabled?: boolean, speed?: number): number;
286
+
246
287
  interface UseTypewriterProgressOptions {
247
288
  totalCharacters: number;
248
289
  speed: number;
@@ -255,8 +296,14 @@ interface UseTypewriterProgressOptions {
255
296
  * Hook that manages typewriter character reveal timing
256
297
  *
257
298
  * @param options - Configuration for typewriter progress
299
+ * @param options.totalCharacters - Total number of characters to reveal
300
+ * @param options.speed - Animation speed multiplier
301
+ * @param options.variance - Typing variance for human-like timing (0-1)
302
+ * @param options.initialDelay - Delay before typing starts in milliseconds
303
+ * @param options.enabled - Whether the animation is enabled
304
+ * @param options.onComplete - Callback when typing completes
258
305
  * @returns Number of characters to display
259
306
  */
260
307
  declare function useTypewriterProgress({ totalCharacters, speed, variance, initialDelay, enabled, onComplete, }: UseTypewriterProgressOptions): number;
261
308
 
262
- export { type BaseEffectProps, type Color, type Colour, type EasingFunction, type EasingName, Fade, Shimmer, Typewriter, Wave, useAnimationFrame, useCursorBlink, useElapsedTime, useTypewriterProgress };
309
+ export { type BaseEffectProps, type Color, type Colour, type EasingFunction, type EasingName, Fade, Flash, Shimmer, Typewriter, Wave, useAnimationFrame, useCursorBlink, useElapsedTime, useTypewriterProgress };