@flight-framework/transitions 0.1.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 (61) hide show
  1. package/README.md +232 -0
  2. package/dist/adapters/react/index.d.ts +210 -0
  3. package/dist/adapters/react/index.js +261 -0
  4. package/dist/adapters/react/index.js.map +1 -0
  5. package/dist/adapters/solid/index.d.ts +5 -0
  6. package/dist/adapters/solid/index.js +9 -0
  7. package/dist/adapters/solid/index.js.map +1 -0
  8. package/dist/adapters/svelte/index.d.ts +5 -0
  9. package/dist/adapters/svelte/index.js +9 -0
  10. package/dist/adapters/svelte/index.js.map +1 -0
  11. package/dist/adapters/vue/index.d.ts +5 -0
  12. package/dist/adapters/vue/index.js +9 -0
  13. package/dist/adapters/vue/index.js.map +1 -0
  14. package/dist/chunk-4SF4GHDQ.js +252 -0
  15. package/dist/chunk-4SF4GHDQ.js.map +1 -0
  16. package/dist/chunk-7R3FXL3A.js +442 -0
  17. package/dist/chunk-7R3FXL3A.js.map +1 -0
  18. package/dist/chunk-BAILQEFB.js +136 -0
  19. package/dist/chunk-BAILQEFB.js.map +1 -0
  20. package/dist/chunk-ITLC6KJ4.js +138 -0
  21. package/dist/chunk-ITLC6KJ4.js.map +1 -0
  22. package/dist/chunk-JRRJMJDL.js +121 -0
  23. package/dist/chunk-JRRJMJDL.js.map +1 -0
  24. package/dist/chunk-UZUZC3MA.js +190 -0
  25. package/dist/chunk-UZUZC3MA.js.map +1 -0
  26. package/dist/chunk-W7HSR35B.js +3 -0
  27. package/dist/chunk-W7HSR35B.js.map +1 -0
  28. package/dist/chunk-WDXXYC7B.js +70 -0
  29. package/dist/chunk-WDXXYC7B.js.map +1 -0
  30. package/dist/chunk-XLVYHPII.js +3 -0
  31. package/dist/chunk-XLVYHPII.js.map +1 -0
  32. package/dist/chunk-ZBJ6FSAK.js +438 -0
  33. package/dist/chunk-ZBJ6FSAK.js.map +1 -0
  34. package/dist/component/index.d.ts +87 -0
  35. package/dist/component/index.js +5 -0
  36. package/dist/component/index.js.map +1 -0
  37. package/dist/config/index.d.ts +93 -0
  38. package/dist/config/index.js +5 -0
  39. package/dist/config/index.js.map +1 -0
  40. package/dist/core/index.d.ts +107 -0
  41. package/dist/core/index.js +5 -0
  42. package/dist/core/index.js.map +1 -0
  43. package/dist/index.d.ts +10 -0
  44. package/dist/index.js +11 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/layout/index.d.ts +112 -0
  47. package/dist/layout/index.js +4 -0
  48. package/dist/layout/index.js.map +1 -0
  49. package/dist/page/index.d.ts +87 -0
  50. package/dist/page/index.js +7 -0
  51. package/dist/page/index.js.map +1 -0
  52. package/dist/presets/index.d.ts +192 -0
  53. package/dist/presets/index.js +3 -0
  54. package/dist/presets/index.js.map +1 -0
  55. package/dist/router/index.d.ts +104 -0
  56. package/dist/router/index.js +7 -0
  57. package/dist/router/index.js.map +1 -0
  58. package/dist/transition-manager-CuO0S_Yn.d.ts +62 -0
  59. package/dist/types-BT3SCjiY.d.ts +272 -0
  60. package/dist/view-transition-Hp-Q9vWJ.d.ts +97 -0
  61. package/package.json +110 -0
@@ -0,0 +1,192 @@
1
+ import { C as CustomTransition, T as TransitionPreset } from '../types-BT3SCjiY.js';
2
+
3
+ /**
4
+ * @flight-framework/transitions - Fade Presets
5
+ *
6
+ * Fade transition presets for smooth opacity-based animations.
7
+ */
8
+
9
+ /**
10
+ * Simple fade transition
11
+ * Elements fade in/out with opacity only
12
+ */
13
+ declare const fade: CustomTransition;
14
+ /**
15
+ * Fade with subtle scale
16
+ * Elements fade and slightly shrink on exit, grow on enter
17
+ */
18
+ declare const fadeScale: CustomTransition;
19
+ /**
20
+ * Fade with blur effect
21
+ * Elements fade and blur on exit, unblur on enter
22
+ */
23
+ declare const fadeBlur: CustomTransition;
24
+ /**
25
+ * Slow fade for dramatic effect
26
+ * Longer duration for hero sections or important content
27
+ */
28
+ declare const fadeSlow: CustomTransition;
29
+ /**
30
+ * Fast fade for snappy UI
31
+ * Quick transitions for responsive feel
32
+ */
33
+ declare const fadeFast: CustomTransition;
34
+
35
+ /**
36
+ * @flight-framework/transitions - Slide Presets
37
+ *
38
+ * Slide transition presets for directional page animations.
39
+ */
40
+
41
+ /**
42
+ * Slide from left
43
+ * New content slides in from the left, old slides out to the right
44
+ */
45
+ declare const slideLeft: CustomTransition;
46
+ /**
47
+ * Slide from right
48
+ * New content slides in from the right, old slides out to the left
49
+ */
50
+ declare const slideRight: CustomTransition;
51
+ /**
52
+ * Slide from top
53
+ * New content slides in from the top, old slides out to the bottom
54
+ */
55
+ declare const slideUp: CustomTransition;
56
+ /**
57
+ * Slide from bottom
58
+ * New content slides in from the bottom, old slides out to the top
59
+ * Common for modals and bottom sheets
60
+ */
61
+ declare const slideDown: CustomTransition;
62
+ /**
63
+ * Slide with fade (subtle offset)
64
+ * Elements slide a small distance while fading
65
+ * Less dramatic than full slide
66
+ */
67
+ declare const slideFade: CustomTransition;
68
+ /**
69
+ * Slide with scale (iOS-like)
70
+ * Elements slide and scale slightly for depth effect
71
+ */
72
+ declare const slideScale: CustomTransition;
73
+ /**
74
+ * Slide overlay (modal-like)
75
+ * New content slides over old content which stays in place
76
+ */
77
+ declare const slideOverlay: CustomTransition;
78
+
79
+ /**
80
+ * @flight-framework/transitions - Scale Presets
81
+ *
82
+ * Scale transition presets for zoom-based animations.
83
+ */
84
+
85
+ /**
86
+ * Scale in/out
87
+ * Elements grow on enter, shrink on exit
88
+ */
89
+ declare const scale: CustomTransition;
90
+ /**
91
+ * Scale up (zoom in effect)
92
+ * Elements scale from smaller to normal
93
+ */
94
+ declare const scaleUp: CustomTransition;
95
+ /**
96
+ * Scale down (zoom out effect)
97
+ * Elements scale from larger to normal
98
+ */
99
+ declare const scaleDown: CustomTransition;
100
+ /**
101
+ * Scale fade (subtle)
102
+ * Very subtle scale with fade for refined UI
103
+ */
104
+ declare const scaleFade: CustomTransition;
105
+ /**
106
+ * Pop (bouncy scale)
107
+ * Elements pop in with overshoot for playful UI
108
+ */
109
+ declare const pop: CustomTransition;
110
+ /**
111
+ * Expand from center
112
+ * Elements expand from center point
113
+ */
114
+ declare const expand: CustomTransition;
115
+
116
+ /**
117
+ * @flight-framework/transitions - Special Presets
118
+ *
119
+ * Special transition presets for advanced effects.
120
+ */
121
+
122
+ /**
123
+ * No transition (instant swap)
124
+ * Use when you want to disable transitions for specific pages
125
+ */
126
+ declare const none: CustomTransition;
127
+ /**
128
+ * Flip horizontal (3D rotation)
129
+ * Elements flip like a card horizontally
130
+ */
131
+ declare const flipX: CustomTransition;
132
+ /**
133
+ * Flip vertical (3D rotation)
134
+ * Elements flip like a card vertically
135
+ */
136
+ declare const flipY: CustomTransition;
137
+ /**
138
+ * Rotate in/out
139
+ * Elements rotate while fading
140
+ */
141
+ declare const rotate: CustomTransition;
142
+ /**
143
+ * Swing in (pendulum effect)
144
+ * Elements swing in from the top
145
+ */
146
+ declare const swing: CustomTransition;
147
+ /**
148
+ * Morph placeholder
149
+ * Actual morph is handled by shared element transitions
150
+ */
151
+ declare const morph: CustomTransition;
152
+ /**
153
+ * Wipe left (reveal effect)
154
+ * Content is revealed from right to left using clip-path
155
+ */
156
+ declare const wipeLeft: CustomTransition;
157
+ /**
158
+ * Wipe up (reveal effect)
159
+ * Content is revealed from bottom to top using clip-path
160
+ */
161
+ declare const wipeUp: CustomTransition;
162
+ /**
163
+ * Circle reveal
164
+ * Content is revealed in a circular pattern from center
165
+ */
166
+ declare const circleReveal: CustomTransition;
167
+
168
+ /**
169
+ * @flight-framework/transitions - Presets Module
170
+ *
171
+ * All transition presets exported for easy consumption.
172
+ */
173
+
174
+ /**
175
+ * Map of preset names to transition definitions
176
+ * Used by resolveTransition to look up presets by name
177
+ */
178
+ declare const presetMap: Record<TransitionPreset, CustomTransition>;
179
+ /**
180
+ * Get a preset transition by name
181
+ */
182
+ declare function getPreset(name: TransitionPreset): CustomTransition | undefined;
183
+ /**
184
+ * Check if a string is a valid preset name
185
+ */
186
+ declare function isPresetName(name: string): name is TransitionPreset;
187
+ /**
188
+ * Get all available preset names
189
+ */
190
+ declare function getPresetNames(): TransitionPreset[];
191
+
192
+ export { circleReveal, expand, fade, fadeBlur, fadeFast, fadeScale, fadeSlow, flipX, flipY, getPreset, getPresetNames, isPresetName, morph, none, pop, presetMap, rotate, scale, scaleDown, scaleFade, scaleUp, slideDown, slideFade, slideLeft, slideOverlay, slideRight, slideScale, slideUp, swing, wipeLeft, wipeUp };
@@ -0,0 +1,3 @@
1
+ export { circleReveal, expand, fade, fadeBlur, fadeFast, fadeScale, fadeSlow, flipX, flipY, getPreset, getPresetNames, isPresetName, morph, none, pop, presetMap, rotate, scale, scaleDown, scaleFade, scaleUp, slideDown, slideFade, slideLeft, slideOverlay, slideRight, slideScale, slideUp, swing, wipeLeft, wipeUp } from '../chunk-ZBJ6FSAK.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,104 @@
1
+ import { T as TransitionPreset, C as CustomTransition, c as TransitionDirection, P as PageTransitionConfig } from '../types-BT3SCjiY.js';
2
+
3
+ /**
4
+ * @flight-framework/transitions - Router Integration
5
+ *
6
+ * Integration with @flight-framework/router for seamless page transitions.
7
+ */
8
+
9
+ /**
10
+ * Options for navigating with transitions
11
+ */
12
+ interface NavigateWithTransitionOptions {
13
+ /** Replace current history entry instead of push */
14
+ replace?: boolean;
15
+ /** Scroll to top after navigation */
16
+ scroll?: boolean;
17
+ /** State to pass to the new route */
18
+ state?: Record<string, unknown>;
19
+ /** Transition to use (overrides page default) */
20
+ transition?: TransitionPreset | CustomTransition | false;
21
+ /** Force transition even if globally disabled */
22
+ forceTransition?: boolean;
23
+ /** Direction hint for the transition */
24
+ direction?: TransitionDirection;
25
+ }
26
+ /**
27
+ * Navigate to a URL with transition support
28
+ *
29
+ * This function wraps the standard navigation with View Transitions API
30
+ * support and integrates with the Flight transitions system.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * import { navigateWithTransition } from '@flight-framework/transitions/router';
35
+ *
36
+ * // Simple navigation
37
+ * await navigateWithTransition('/about');
38
+ *
39
+ * // With options
40
+ * await navigateWithTransition('/dashboard', {
41
+ * transition: 'slide-left',
42
+ * replace: false,
43
+ * });
44
+ * ```
45
+ */
46
+ declare function navigateWithTransition(to: string, options?: NavigateWithTransitionOptions): Promise<void>;
47
+ /**
48
+ * Set up history navigation listeners for back/forward transitions
49
+ *
50
+ * Call this once during app initialization to enable transitions
51
+ * for browser back/forward navigation.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * import { setupHistoryTransitions } from '@flight-framework/transitions/router';
56
+ *
57
+ * // In your app initialization
58
+ * setupHistoryTransitions();
59
+ * ```
60
+ */
61
+ declare function setupHistoryTransitions(): () => void;
62
+ /**
63
+ * Prefetch a route's assets for faster transitions
64
+ *
65
+ * @example
66
+ * ```typescript
67
+ * // Prefetch on hover
68
+ * element.addEventListener('mouseenter', () => {
69
+ * prefetchRoute('/about');
70
+ * });
71
+ * ```
72
+ */
73
+ declare function prefetchRoute(url: string): void;
74
+ /**
75
+ * Check if a route has been prefetched
76
+ */
77
+ declare function isRoutePrefetched(url: string): boolean;
78
+ /**
79
+ * Configure transitions based on route patterns
80
+ */
81
+ interface RouteTransitionConfig {
82
+ /** Route pattern (supports wildcards) */
83
+ pattern: string;
84
+ /** Transition configuration for this route */
85
+ transition: PageTransitionConfig;
86
+ }
87
+ /**
88
+ * Register transition configs for route patterns
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * registerRouteTransitions([
93
+ * { pattern: '/dashboard/*', transition: { default: 'slide-left' } },
94
+ * { pattern: '/settings', transition: { default: 'fade' } },
95
+ * ]);
96
+ * ```
97
+ */
98
+ declare function registerRouteTransitions(configs: RouteTransitionConfig[]): void;
99
+ /**
100
+ * Get transition config for a route based on registered patterns
101
+ */
102
+ declare function getRouteTransitionConfig(path: string): PageTransitionConfig | undefined;
103
+
104
+ export { type NavigateWithTransitionOptions, type RouteTransitionConfig, getRouteTransitionConfig, isRoutePrefetched, navigateWithTransition, prefetchRoute, registerRouteTransitions, setupHistoryTransitions };
@@ -0,0 +1,7 @@
1
+ export { getRouteTransitionConfig, isRoutePrefetched, navigateWithTransition, prefetchRoute, registerRouteTransitions, setupHistoryTransitions } from '../chunk-JRRJMJDL.js';
2
+ import '../chunk-ITLC6KJ4.js';
3
+ import '../chunk-ZBJ6FSAK.js';
4
+ import '../chunk-7R3FXL3A.js';
5
+ import '../chunk-4SF4GHDQ.js';
6
+ //# sourceMappingURL=index.js.map
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,62 @@
1
+ import { i as TransitionsConfig, j as TransitionState, k as TransitionListener, P as PageTransitionConfig, c as TransitionDirection } from './types-BT3SCjiY.js';
2
+
3
+ /**
4
+ * @flight-framework/transitions - Transition Manager
5
+ *
6
+ * Central orchestrator for all transition operations.
7
+ * Manages state, configuration, and coordinates between different
8
+ * transition types (page, layout, component).
9
+ */
10
+
11
+ /**
12
+ * Create a new transition manager instance
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const manager = createTransitionManager({
17
+ * pageTransition: 'fade',
18
+ * duration: 200,
19
+ * });
20
+ *
21
+ * // Subscribe to state changes
22
+ * manager.subscribe((state) => {
23
+ * console.log('Transition state:', state);
24
+ * });
25
+ *
26
+ * // Start a transition
27
+ * await manager.startPageTransition('/new-page');
28
+ * ```
29
+ */
30
+ declare function createTransitionManager(initialConfig?: TransitionsConfig): TransitionManager;
31
+ interface TransitionManager {
32
+ /** Get current transition state (readonly copy) */
33
+ getState(): TransitionState;
34
+ /** Get current configuration (readonly copy) */
35
+ getConfig(): TransitionsConfig;
36
+ /** Update configuration */
37
+ configure(config: TransitionsConfig): void;
38
+ /** Subscribe to state changes, returns unsubscribe function */
39
+ subscribe(listener: TransitionListener): () => void;
40
+ /** Start a page transition */
41
+ startPageTransition(to: string, config?: PageTransitionConfig): Promise<void>;
42
+ /** Skip the current transition immediately */
43
+ skipTransition(): void;
44
+ /** Check if transitions are enabled */
45
+ isEnabled(): boolean;
46
+ /** Check if View Transitions API is supported */
47
+ isViewTransitionSupported(): boolean;
48
+ /** Set the navigation direction */
49
+ setDirection(direction: TransitionDirection): void;
50
+ /** Clean up resources */
51
+ destroy(): void;
52
+ }
53
+ /**
54
+ * Get or create the global transition manager instance
55
+ */
56
+ declare function getTransitionManager(): TransitionManager;
57
+ /**
58
+ * Initialize the global transition manager with configuration
59
+ */
60
+ declare function initTransitions(config: TransitionsConfig): TransitionManager;
61
+
62
+ export { type TransitionManager as T, createTransitionManager as c, getTransitionManager as g, initTransitions as i };
@@ -0,0 +1,272 @@
1
+ /**
2
+ * @flight-framework/transitions - Core Types
3
+ *
4
+ * Type definitions for the Flight Transitions system.
5
+ * Following 2026 best practices with strict TypeScript.
6
+ */
7
+ /**
8
+ * Native ViewTransition interface (matches browser API)
9
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition
10
+ */
11
+ interface ViewTransition {
12
+ /** Promise that resolves when the DOM update callback completes */
13
+ readonly updateCallbackDone: Promise<void>;
14
+ /** Promise that resolves when pseudo-element tree is ready to animate */
15
+ readonly ready: Promise<void>;
16
+ /** Promise that resolves when animation completes and new view is interactive */
17
+ readonly finished: Promise<void>;
18
+ /** Skip the transition animation */
19
+ skipTransition(): void;
20
+ }
21
+ /**
22
+ * Options for starting a view transition
23
+ */
24
+ interface ViewTransitionOptions {
25
+ /** Unique name for CSS targeting via view-transition-name */
26
+ name?: string;
27
+ /** Skip the transition entirely (instant swap) */
28
+ skipTransition?: boolean;
29
+ /** Custom CSS classes applied during transition phases */
30
+ classes?: {
31
+ /** Class added to old (leaving) snapshot */
32
+ old?: string;
33
+ /** Class added to new (entering) snapshot */
34
+ new?: string;
35
+ };
36
+ /** Types for the transition (used with @view-transition types) */
37
+ types?: string[];
38
+ }
39
+ /**
40
+ * Result from startViewTransition wrapper
41
+ */
42
+ interface ViewTransitionResult {
43
+ /** Promise resolving when ready to animate */
44
+ readonly ready: Promise<void>;
45
+ /** Promise resolving when animation finishes */
46
+ readonly finished: Promise<void>;
47
+ /** Promise resolving when DOM update callback completes */
48
+ readonly updateCallbackDone: Promise<void>;
49
+ /** Skip the remaining animation */
50
+ skipTransition(): void;
51
+ /** Whether native API was used */
52
+ readonly isNative: boolean;
53
+ }
54
+ /** Built-in transition preset names */
55
+ type TransitionPreset = 'fade' | 'fade-scale' | 'slide-left' | 'slide-right' | 'slide-up' | 'slide-down' | 'scale' | 'scale-fade' | 'morph' | 'flip' | 'none';
56
+ /** Direction for directional transitions */
57
+ type TransitionDirection = 'forward' | 'back' | 'auto';
58
+ /** CSS properties that can be animated */
59
+ type AnimatableProperty = 'opacity' | 'transform' | 'clip-path' | 'filter' | 'background-color' | 'color' | string;
60
+ /**
61
+ * Keyframe definition for a transition phase
62
+ */
63
+ interface TransitionKeyframe {
64
+ /** Starting CSS values */
65
+ from: Partial<Record<AnimatableProperty, string>>;
66
+ /** Ending CSS values */
67
+ to: Partial<Record<AnimatableProperty, string>>;
68
+ }
69
+ /**
70
+ * Custom transition definition
71
+ */
72
+ interface CustomTransition {
73
+ /** Name identifier for the transition */
74
+ name?: string;
75
+ /** Animation for the leaving element */
76
+ leave?: TransitionKeyframe;
77
+ /** Animation for the entering element */
78
+ enter?: TransitionKeyframe;
79
+ /** Duration in milliseconds */
80
+ duration?: number | {
81
+ leave?: number;
82
+ enter?: number;
83
+ };
84
+ /** Easing function(s) */
85
+ easing?: string | {
86
+ leave?: string;
87
+ enter?: string;
88
+ };
89
+ /** Delay before animation starts */
90
+ delay?: number | {
91
+ leave?: number;
92
+ enter?: number;
93
+ };
94
+ /** CSS fill mode */
95
+ fill?: FillMode;
96
+ }
97
+ /** Animation fill mode */
98
+ type FillMode = 'none' | 'forwards' | 'backwards' | 'both';
99
+ /**
100
+ * Resolved transition (preset or custom normalized to common format)
101
+ */
102
+ interface ResolvedTransition {
103
+ name: string;
104
+ leave: {
105
+ keyframes: Keyframe[];
106
+ options: KeyframeAnimationOptions;
107
+ };
108
+ enter: {
109
+ keyframes: Keyframe[];
110
+ options: KeyframeAnimationOptions;
111
+ };
112
+ }
113
+ /**
114
+ * Configuration for page-level transitions
115
+ */
116
+ interface PageTransitionConfig {
117
+ /** Default transition for all navigations */
118
+ default?: TransitionPreset | CustomTransition | false;
119
+ /** Transition for back navigation (overrides default) */
120
+ backTransition?: TransitionPreset | CustomTransition | false;
121
+ /** Duration override */
122
+ duration?: number;
123
+ /** Easing override */
124
+ easing?: string;
125
+ /** How to handle prefers-reduced-motion */
126
+ reduceMotion?: ReduceMotionBehavior;
127
+ /** Callback before transition starts */
128
+ onStart?: (context: TransitionContext) => void;
129
+ /** Callback after transition completes */
130
+ onComplete?: (context: TransitionContext) => void;
131
+ }
132
+ /** Behavior for users with reduced motion preference */
133
+ type ReduceMotionBehavior = 'respect-system' | 'always-reduce' | 'ignore';
134
+ /**
135
+ * Context passed to transition callbacks
136
+ */
137
+ interface TransitionContext {
138
+ /** The URL being navigated from */
139
+ from: string;
140
+ /** The URL being navigated to */
141
+ to: string;
142
+ /** Navigation direction */
143
+ direction: TransitionDirection;
144
+ /** The transition being used */
145
+ transition: ResolvedTransition;
146
+ /** Timestamp when transition started */
147
+ startTime: number;
148
+ }
149
+ /**
150
+ * Configuration for layout-level transitions
151
+ */
152
+ interface LayoutTransitionConfig {
153
+ /** Default layout transition */
154
+ default?: TransitionPreset | CustomTransition | false;
155
+ /** Whether layout persists during page transitions */
156
+ persist?: boolean;
157
+ /** Shared elements configuration */
158
+ sharedElements?: SharedElementConfig[];
159
+ }
160
+ /**
161
+ * Shared element transition configuration
162
+ */
163
+ interface SharedElementConfig {
164
+ /** Unique identifier matching elements across pages */
165
+ name: string;
166
+ /** Animation type for the shared element */
167
+ animation?: 'morph' | 'crossfade' | 'none';
168
+ /** Duration for the shared element animation */
169
+ duration?: number;
170
+ /** Easing for the shared element animation */
171
+ easing?: string;
172
+ }
173
+ /**
174
+ * Props for component-level transitions
175
+ */
176
+ interface TransitionProps {
177
+ /** Whether the child should be shown */
178
+ show?: boolean;
179
+ /** Transition type */
180
+ type?: TransitionPreset | CustomTransition;
181
+ /** Duration override */
182
+ duration?: number;
183
+ /** Appear on initial mount */
184
+ appear?: boolean;
185
+ /** Mode for enter/leave sequencing */
186
+ mode?: 'in-out' | 'out-in' | 'simultaneous';
187
+ /** Callback when enter transition starts */
188
+ onEnterStart?: () => void;
189
+ /** Callback when enter transition completes */
190
+ onEnterComplete?: () => void;
191
+ /** Callback when leave transition starts */
192
+ onLeaveStart?: () => void;
193
+ /** Callback when leave transition completes */
194
+ onLeaveComplete?: () => void;
195
+ }
196
+ /**
197
+ * Props for transition groups (list animations)
198
+ */
199
+ interface TransitionGroupProps {
200
+ /** Tag to render as container */
201
+ as?: keyof HTMLElementTagNameMap;
202
+ /** Transition for items */
203
+ type?: TransitionPreset | CustomTransition;
204
+ /** Duration for each item */
205
+ duration?: number;
206
+ /** Stagger delay between items */
207
+ stagger?: number;
208
+ /** Whether to animate on initial render */
209
+ appear?: boolean;
210
+ }
211
+ /**
212
+ * Global transitions configuration (for flight.config.ts)
213
+ */
214
+ interface TransitionsConfig {
215
+ /** Enable transitions globally */
216
+ enabled?: boolean;
217
+ /** Use native View Transitions API when available */
218
+ viewTransitions?: boolean;
219
+ /** Default page transition */
220
+ pageTransition?: TransitionPreset | CustomTransition | false;
221
+ /** Default layout transition */
222
+ layoutTransition?: TransitionPreset | CustomTransition | false;
223
+ /** Global duration default */
224
+ duration?: number;
225
+ /** Global easing default */
226
+ easing?: string;
227
+ /** Reduced motion behavior */
228
+ reduceMotion?: ReduceMotionBehavior;
229
+ /** Enable cross-document (MPA) transitions */
230
+ crossDocument?: boolean;
231
+ }
232
+ /**
233
+ * Internal transition state
234
+ */
235
+ interface TransitionState {
236
+ isTransitioning: boolean;
237
+ direction: TransitionDirection;
238
+ phase: 'idle' | 'leaving' | 'entering' | 'complete';
239
+ currentTransition: ResolvedTransition | null;
240
+ fromPath: string | null;
241
+ toPath: string | null;
242
+ }
243
+ /** Listener for transition state changes */
244
+ type TransitionListener = (state: TransitionState) => void;
245
+ /** Extract the resolved transition type from preset or custom */
246
+ type TransitionInput = TransitionPreset | CustomTransition | false;
247
+ /** Navigation options extended with transition support */
248
+ interface NavigateWithTransitionOptions {
249
+ /** Replace current history entry */
250
+ replace?: boolean;
251
+ /** Scroll to top after navigation */
252
+ scroll?: boolean;
253
+ /** State to pass to new route */
254
+ state?: Record<string, unknown>;
255
+ /** Transition to use (overrides page default) */
256
+ transition?: TransitionInput;
257
+ /** Force transition even if globally disabled */
258
+ forceTransition?: boolean;
259
+ }
260
+ /** Link props extended with transition support */
261
+ interface LinkWithTransitionProps {
262
+ /** Target URL */
263
+ href: string;
264
+ /** Transition for this link */
265
+ transition?: TransitionInput;
266
+ /** Prefetch transition assets on hover */
267
+ prefetchTransition?: boolean;
268
+ /** Replace instead of push */
269
+ replace?: boolean;
270
+ }
271
+
272
+ export type { AnimatableProperty as A, CustomTransition as C, FillMode as F, LayoutTransitionConfig as L, NavigateWithTransitionOptions as N, PageTransitionConfig as P, ResolvedTransition as R, SharedElementConfig as S, TransitionPreset as T, ViewTransition as V, ViewTransitionOptions as a, ViewTransitionResult as b, TransitionDirection as c, TransitionKeyframe as d, ReduceMotionBehavior as e, TransitionContext as f, TransitionProps as g, TransitionGroupProps as h, TransitionsConfig as i, TransitionState as j, TransitionListener as k, TransitionInput as l, LinkWithTransitionProps as m };