@aphrody/m3-motion 3.2.5 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,243 +1,243 @@
1
- # @aphrody/m3-motion
2
-
3
- High-fidelity React animation components for Material Design 3 (M3) motion specifications, powered by [Motion](https://motion.dev/) (formerly Framer Motion).
4
-
5
- This package implements the core Material Design 3 motion patterns—including **Container Transform**, **Shared Axis**, **Fade Through**, **Collapse**, and **Fade**—using Google's official spring, easing, and duration tokens.
6
-
7
- ---
8
-
9
- ## Installation
10
-
11
- ```bash
12
- bun add @aphrody/m3-motion motion
13
- ```
14
-
15
- Ensure you have `react` (>= 18.0.0) and `motion` (>= 12.0.0) installed in your project.
16
-
17
- ---
18
-
19
- ## 1. Container Transform (`M3ContainerTransform`)
20
-
21
- The container transform pattern transitions one UI element to another (e.g., morphing a small Card component into a full-page Detail view).
22
-
23
- ### Key Features
24
- * **Aspect Ratio Preservation**: Automatically prevents layout distortion (skewing/stretching) of children during container morphs using layout-position correction.
25
- * **Spec-Compliant Cross-Fade**: Fades out the starting content early (0% to 30% of transition) and delays the fade-in of target content (20% to 100% of transition) to avoid messy intermediate states.
26
- * **Pointer Event Management**: Prevents inactive, hidden content from intercepting pointer interactions.
27
- * **Flexibility**: Supports both the **Single-Container Toggle** approach (re-rendering within the same container) and the **Two-Container Shared Layout** approach (different source/target elements linked via `layoutId`).
28
-
29
- ### Sub-Components
30
- * `M3ContainerTransform`: Parent morphing container.
31
- * `M3ContainerTransformStart`: Wrapper for starting content (e.g., collapsed card details).
32
- * `M3ContainerTransformEnd`: Wrapper for ending content (e.g., expanded page details).
33
-
34
- ---
35
-
36
- ### Code Examples
37
-
38
- #### Single-Container Toggle Approach
39
- Best when morphing a single component instance in place using state.
40
-
41
- ```tsx
42
- import React, { useState } from "react";
43
- import {
44
- M3ContainerTransform,
45
- M3ContainerTransformStart,
46
- M3ContainerTransformEnd
47
- } from "@aphrody/m3-motion";
48
-
49
- export const MorphingCard = () => {
50
- const [isExpanded, setIsExpanded] = useState(false);
51
-
52
- return (
53
- <M3ContainerTransform
54
- isExpanded={isExpanded}
55
- speed="default"
56
- style={{
57
- width: isExpanded ? 500 : 250,
58
- height: isExpanded ? 400 : 150,
59
- borderRadius: isExpanded ? 28 : 16,
60
- backgroundColor: "var(--md-sys-color-surface-container)",
61
- cursor: "pointer"
62
- }}
63
- onClick={() => setIsExpanded(!isExpanded)}
64
- >
65
- {/* Start state (collapsed content) */}
66
- <M3ContainerTransformStart>
67
- <div style={{ padding: 16 }}>
68
- <h3>Collapsed Card</h3>
69
- <p>Click me to expand...</p>
70
- </div>
71
- </M3ContainerTransformStart>
72
-
73
- {/* End state (expanded detail content) */}
74
- <M3ContainerTransformEnd>
75
- <div style={{ padding: 24 }}>
76
- <h2>Detailed View</h2>
77
- <p>This is the expanded content showing the full detail surface.</p>
78
- <button onClick={(e) => { e.stopPropagation(); setIsExpanded(false); }}>
79
- Close
80
- </button>
81
- </div>
82
- </M3ContainerTransformEnd>
83
- </M3ContainerTransform>
84
- );
85
- };
86
- ```
87
-
88
- #### Two-Container Shared Layout Approach (linked via `layoutId`)
89
- Best for page/route transitions or separate DOM elements. Wrap the conditional render in `<AnimatePresence>` to enable the exit fade-out transition.
90
-
91
- ```tsx
92
- import React, { useState } from "react";
93
- import { AnimatePresence } from "motion/react";
94
- import {
95
- M3ContainerTransform,
96
- M3ContainerTransformStart,
97
- M3ContainerTransformEnd
98
- } from "@aphrody/m3-motion";
99
-
100
- export const ListView = () => {
101
- const [selectedId, setSelectedId] = useState<string | null>(null);
102
-
103
- return (
104
- <div>
105
- {/* List of items */}
106
- {!selectedId && (
107
- <div className="grid">
108
- <M3ContainerTransform
109
- layoutId="card-item-1"
110
- onClick={() => setSelectedId("1")}
111
- style={{ borderRadius: 16, background: "#eee", width: 200, height: 120 }}
112
- >
113
- <M3ContainerTransformStart>
114
- <div style={{ padding: 12 }}>Card Content 1</div>
115
- </M3ContainerTransformStart>
116
- </M3ContainerTransform>
117
- </div>
118
- )}
119
-
120
- {/* Expanded detail page */}
121
- <AnimatePresence>
122
- {selectedId === "1" && (
123
- <div className="backdrop">
124
- <M3ContainerTransform
125
- layoutId="card-item-1"
126
- style={{ borderRadius: 24, background: "#fff", width: 600, height: 450 }}
127
- >
128
- <M3ContainerTransformEnd>
129
- <div style={{ padding: 24 }}>
130
- <h2>Expanded Title 1</h2>
131
- <p>Long detail text...</p>
132
- <button onClick={() => setSelectedId(null)}>Back to List</button>
133
- </div>
134
- </M3ContainerTransformEnd>
135
- </M3ContainerTransform>
136
- </div>
137
- )}
138
- </AnimatePresence>
139
- </div>
140
- );
141
- };
142
- ```
143
-
144
- ---
145
-
146
- ## 2. Shared Axis (`M3SharedAxis`)
147
-
148
- Used for transitions between UI elements that have a spatial or navigational relationship (e.g., page stepper, tab switching, or dialog overlays). Supports `x`, `y`, and `z` axes.
149
-
150
- * Default enter duration: **300ms** (`medium2`) with `emphasizedDecelerate` ease.
151
- * Default exit duration: **200ms** (`short4`) with `emphasizedAccelerate` ease.
152
-
153
- ### Code Example
154
-
155
- ```tsx
156
- import React, { useState } from "react";
157
- import { M3SharedAxis } from "@aphrody/m3-motion";
158
-
159
- export const StepWizard = () => {
160
- const [step, setStep] = useState(0);
161
-
162
- return (
163
- <div>
164
- <M3SharedAxis
165
- stateKey={step}
166
- axis="x"
167
- forward={step > 0}
168
- style={{ padding: 20 }}
169
- >
170
- {step === 0 && <div>Step 1: Enter details</div>}
171
- {step === 1 && <div>Step 2: Review options</div>}
172
- {step === 2 && <div>Step 3: Confirm purchase</div>}
173
- </M3SharedAxis>
174
-
175
- <button onClick={() => setStep(prev => Math.max(0, prev - 1))}>Back</button>
176
- <button onClick={() => setStep(prev => Math.min(2, prev + 1))}>Next</button>
177
- </div>
178
- );
179
- };
180
- ```
181
-
182
- ---
183
-
184
- ## 3. Fade Through (`M3FadeThrough`)
185
-
186
- Used for transitions between primary views that do not have a strong spatial relationship (e.g., bottom navigation switching, settings screens).
187
-
188
- * Default exit duration (fade-out): **90ms** with `emphasizedAccelerate` ease.
189
- * Default enter duration (fade-in & scale-up from 92%): **210ms** with `emphasizedDecelerate` ease.
190
-
191
- ### Code Example
192
-
193
- ```tsx
194
- import React, { useState } from "react";
195
- import { M3FadeThrough } from "@aphrody/m3-motion";
196
-
197
- export const AppNavigation = () => {
198
- const [currentTab, setCurrentTab] = useState("home");
199
-
200
- return (
201
- <div>
202
- <M3FadeThrough stateKey={currentTab} style={{ height: 400 }}>
203
- {currentTab === "home" && <div>Home View Content</div>}
204
- {currentTab === "search" && <div>Search Page Content</div>}
205
- {currentTab === "profile" && <div>User Profile Settings</div>}
206
- </M3FadeThrough>
207
-
208
- <nav>
209
- <button onClick={() => setCurrentTab("home")}>Home</button>
210
- <button onClick={() => setCurrentTab("search")}>Search</button>
211
- <button onClick={() => setCurrentTab("profile")}>Profile</button>
212
- </nav>
213
- </div>
214
- );
215
- };
216
- ```
217
-
218
- ---
219
-
220
- ## 4. Duration and Easing Presets
221
-
222
- Developers have direct access to official Material Design 3 timings and curves:
223
-
224
- ```tsx
225
- import { m3Easings, m3Durations, m3Springs } from "@aphrody/m3-motion";
226
-
227
- // Custom animation example using M3 tokens
228
- const myCustomTransition = {
229
- ease: m3Easings.emphasizedDecelerate,
230
- duration: m3Durations.medium4, // 400ms
231
- };
232
- ```
233
-
234
- ### Motion Presets Summary
235
- * **`m3Easings`**: Bezier curves for `emphasized` (approx), `emphasizedDecelerate` (enter), `emphasizedAccelerate` (exit), `standard`, `standardDecelerate`, and `standardAccelerate`.
236
- * **`m3Durations`**: Timing scales from `short1` (50ms) to `extraLong4` (1000ms).
237
- * **`m3Springs`**: Hand-tuned spring constants (`fast`, `default`, `slow`) split into `spatial` (bouncy) and `effects` (critically damped).
238
-
239
- ---
240
-
241
- ## License
242
-
243
- Apache-2.0
1
+ # @aphrody/m3-motion
2
+
3
+ High-fidelity React animation components for Material Design 3 (M3) motion specifications, powered by [Motion](https://motion.dev/) (formerly Framer Motion).
4
+
5
+ This package implements the core Material Design 3 motion patterns—including **Container Transform**, **Shared Axis**, **Fade Through**, **Collapse**, and **Fade**—using Google's official spring, easing, and duration tokens.
6
+
7
+ ---
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ bun add @aphrody/m3-motion motion
13
+ ```
14
+
15
+ Ensure you have `react` (>= 18.0.0) and `motion` (>= 12.0.0) installed in your project.
16
+
17
+ ---
18
+
19
+ ## 1. Container Transform (`M3ContainerTransform`)
20
+
21
+ The container transform pattern transitions one UI element to another (e.g., morphing a small Card component into a full-page Detail view).
22
+
23
+ ### Key Features
24
+ * **Aspect Ratio Preservation**: Automatically prevents layout distortion (skewing/stretching) of children during container morphs using layout-position correction.
25
+ * **Spec-Compliant Cross-Fade**: Fades out the starting content early (0% to 30% of transition) and delays the fade-in of target content (20% to 100% of transition) to avoid messy intermediate states.
26
+ * **Pointer Event Management**: Prevents inactive, hidden content from intercepting pointer interactions.
27
+ * **Flexibility**: Supports both the **Single-Container Toggle** approach (re-rendering within the same container) and the **Two-Container Shared Layout** approach (different source/target elements linked via `layoutId`).
28
+
29
+ ### Sub-Components
30
+ * `M3ContainerTransform`: Parent morphing container.
31
+ * `M3ContainerTransformStart`: Wrapper for starting content (e.g., collapsed card details).
32
+ * `M3ContainerTransformEnd`: Wrapper for ending content (e.g., expanded page details).
33
+
34
+ ---
35
+
36
+ ### Code Examples
37
+
38
+ #### Single-Container Toggle Approach
39
+ Best when morphing a single component instance in place using state.
40
+
41
+ ```tsx
42
+ import React, { useState } from "react";
43
+ import {
44
+ M3ContainerTransform,
45
+ M3ContainerTransformStart,
46
+ M3ContainerTransformEnd
47
+ } from "@aphrody/m3-motion";
48
+
49
+ export const MorphingCard = () => {
50
+ const [isExpanded, setIsExpanded] = useState(false);
51
+
52
+ return (
53
+ <M3ContainerTransform
54
+ isExpanded={isExpanded}
55
+ speed="default"
56
+ style={{
57
+ width: isExpanded ? 500 : 250,
58
+ height: isExpanded ? 400 : 150,
59
+ borderRadius: isExpanded ? 28 : 16,
60
+ backgroundColor: "var(--md-sys-color-surface-container)",
61
+ cursor: "pointer"
62
+ }}
63
+ onClick={() => setIsExpanded(!isExpanded)}
64
+ >
65
+ {/* Start state (collapsed content) */}
66
+ <M3ContainerTransformStart>
67
+ <div style={{ padding: 16 }}>
68
+ <h3>Collapsed Card</h3>
69
+ <p>Click me to expand...</p>
70
+ </div>
71
+ </M3ContainerTransformStart>
72
+
73
+ {/* End state (expanded detail content) */}
74
+ <M3ContainerTransformEnd>
75
+ <div style={{ padding: 24 }}>
76
+ <h2>Detailed View</h2>
77
+ <p>This is the expanded content showing the full detail surface.</p>
78
+ <button onClick={(e) => { e.stopPropagation(); setIsExpanded(false); }}>
79
+ Close
80
+ </button>
81
+ </div>
82
+ </M3ContainerTransformEnd>
83
+ </M3ContainerTransform>
84
+ );
85
+ };
86
+ ```
87
+
88
+ #### Two-Container Shared Layout Approach (linked via `layoutId`)
89
+ Best for page/route transitions or separate DOM elements. Wrap the conditional render in `<AnimatePresence>` to enable the exit fade-out transition.
90
+
91
+ ```tsx
92
+ import React, { useState } from "react";
93
+ import { AnimatePresence } from "motion/react";
94
+ import {
95
+ M3ContainerTransform,
96
+ M3ContainerTransformStart,
97
+ M3ContainerTransformEnd
98
+ } from "@aphrody/m3-motion";
99
+
100
+ export const ListView = () => {
101
+ const [selectedId, setSelectedId] = useState<string | null>(null);
102
+
103
+ return (
104
+ <div>
105
+ {/* List of items */}
106
+ {!selectedId && (
107
+ <div className="grid">
108
+ <M3ContainerTransform
109
+ layoutId="card-item-1"
110
+ onClick={() => setSelectedId("1")}
111
+ style={{ borderRadius: 16, background: "#eee", width: 200, height: 120 }}
112
+ >
113
+ <M3ContainerTransformStart>
114
+ <div style={{ padding: 12 }}>Card Content 1</div>
115
+ </M3ContainerTransformStart>
116
+ </M3ContainerTransform>
117
+ </div>
118
+ )}
119
+
120
+ {/* Expanded detail page */}
121
+ <AnimatePresence>
122
+ {selectedId === "1" && (
123
+ <div className="backdrop">
124
+ <M3ContainerTransform
125
+ layoutId="card-item-1"
126
+ style={{ borderRadius: 24, background: "#fff", width: 600, height: 450 }}
127
+ >
128
+ <M3ContainerTransformEnd>
129
+ <div style={{ padding: 24 }}>
130
+ <h2>Expanded Title 1</h2>
131
+ <p>Long detail text...</p>
132
+ <button onClick={() => setSelectedId(null)}>Back to List</button>
133
+ </div>
134
+ </M3ContainerTransformEnd>
135
+ </M3ContainerTransform>
136
+ </div>
137
+ )}
138
+ </AnimatePresence>
139
+ </div>
140
+ );
141
+ };
142
+ ```
143
+
144
+ ---
145
+
146
+ ## 2. Shared Axis (`M3SharedAxis`)
147
+
148
+ Used for transitions between UI elements that have a spatial or navigational relationship (e.g., page stepper, tab switching, or dialog overlays). Supports `x`, `y`, and `z` axes.
149
+
150
+ * Default enter duration: **300ms** (`medium2`) with `emphasizedDecelerate` ease.
151
+ * Default exit duration: **200ms** (`short4`) with `emphasizedAccelerate` ease.
152
+
153
+ ### Code Example
154
+
155
+ ```tsx
156
+ import React, { useState } from "react";
157
+ import { M3SharedAxis } from "@aphrody/m3-motion";
158
+
159
+ export const StepWizard = () => {
160
+ const [step, setStep] = useState(0);
161
+
162
+ return (
163
+ <div>
164
+ <M3SharedAxis
165
+ stateKey={step}
166
+ axis="x"
167
+ forward={step > 0}
168
+ style={{ padding: 20 }}
169
+ >
170
+ {step === 0 && <div>Step 1: Enter details</div>}
171
+ {step === 1 && <div>Step 2: Review options</div>}
172
+ {step === 2 && <div>Step 3: Confirm purchase</div>}
173
+ </M3SharedAxis>
174
+
175
+ <button onClick={() => setStep(prev => Math.max(0, prev - 1))}>Back</button>
176
+ <button onClick={() => setStep(prev => Math.min(2, prev + 1))}>Next</button>
177
+ </div>
178
+ );
179
+ };
180
+ ```
181
+
182
+ ---
183
+
184
+ ## 3. Fade Through (`M3FadeThrough`)
185
+
186
+ Used for transitions between primary views that do not have a strong spatial relationship (e.g., bottom navigation switching, settings screens).
187
+
188
+ * Default exit duration (fade-out): **90ms** with `emphasizedAccelerate` ease.
189
+ * Default enter duration (fade-in & scale-up from 92%): **210ms** with `emphasizedDecelerate` ease.
190
+
191
+ ### Code Example
192
+
193
+ ```tsx
194
+ import React, { useState } from "react";
195
+ import { M3FadeThrough } from "@aphrody/m3-motion";
196
+
197
+ export const AppNavigation = () => {
198
+ const [currentTab, setCurrentTab] = useState("home");
199
+
200
+ return (
201
+ <div>
202
+ <M3FadeThrough stateKey={currentTab} style={{ height: 400 }}>
203
+ {currentTab === "home" && <div>Home View Content</div>}
204
+ {currentTab === "search" && <div>Search Page Content</div>}
205
+ {currentTab === "profile" && <div>User Profile Settings</div>}
206
+ </M3FadeThrough>
207
+
208
+ <nav>
209
+ <button onClick={() => setCurrentTab("home")}>Home</button>
210
+ <button onClick={() => setCurrentTab("search")}>Search</button>
211
+ <button onClick={() => setCurrentTab("profile")}>Profile</button>
212
+ </nav>
213
+ </div>
214
+ );
215
+ };
216
+ ```
217
+
218
+ ---
219
+
220
+ ## 4. Duration and Easing Presets
221
+
222
+ Developers have direct access to official Material Design 3 timings and curves:
223
+
224
+ ```tsx
225
+ import { m3Easings, m3Durations, m3Springs } from "@aphrody/m3-motion";
226
+
227
+ // Custom animation example using M3 tokens
228
+ const myCustomTransition = {
229
+ ease: m3Easings.emphasizedDecelerate,
230
+ duration: m3Durations.medium4, // 400ms
231
+ };
232
+ ```
233
+
234
+ ### Motion Presets Summary
235
+ * **`m3Easings`**: Bezier curves for `emphasized` (approx), `emphasizedDecelerate` (enter), `emphasizedAccelerate` (exit), `standard`, `standardDecelerate`, and `standardAccelerate`.
236
+ * **`m3Durations`**: Timing scales from `short1` (50ms) to `extraLong4` (1000ms).
237
+ * **`m3Springs`**: Hand-tuned spring constants (`fast`, `default`, `slow`) split into `spatial` (bouncy) and `effects` (critically damped).
238
+
239
+ ---
240
+
241
+ ## License
242
+
243
+ Apache-2.0
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ import type { HTMLMotionProps } from "motion/react";
3
+ export interface M3CollapseProps extends HTMLMotionProps<"div"> {
4
+ /**
5
+ * If true, the component expands. If false, it collapses.
6
+ * If omitted, the component behaves as a standard motion element meant to be unmounted/mounted
7
+ * by an external <AnimatePresence>.
8
+ */
9
+ in?: boolean;
10
+ /**
11
+ * If true, animate the transition on initial mount.
12
+ * @default false
13
+ */
14
+ appear?: boolean;
15
+ }
16
+ /**
17
+ * M3Collapse transition component.
18
+ * Animates the height and opacity of its children, perfect for accordions, menus, or disclosures.
19
+ */
20
+ export declare const M3Collapse: React.ForwardRefExoticComponent<Omit<M3CollapseProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
21
+ //# sourceMappingURL=M3Collapse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"M3Collapse.d.ts","sourceRoot":"","sources":["../../src/components/M3Collapse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,WAAW,eAAgB,SAAQ,eAAe,CAAC,KAAK,CAAC;IAC7D;;;;OAIG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,qGAsDtB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import * as React from "react";
2
+ import type { HTMLMotionProps } from "motion/react";
3
+ export interface M3ContainerTransformProps extends HTMLMotionProps<"div"> {
4
+ /**
5
+ * Shared identifier linking the starting container (e.g., card) and ending container (e.g., detail page).
6
+ */
7
+ layoutId?: string;
8
+ /**
9
+ * Speed preset to use for the morphing animation.
10
+ * @default "default"
11
+ */
12
+ speed?: "fast" | "default" | "slow";
13
+ /**
14
+ * If true, renders the expanded container state.
15
+ * @default false
16
+ */
17
+ isExpanded?: boolean;
18
+ }
19
+ export interface M3ContainerTransformContextValue {
20
+ isExpanded: boolean;
21
+ speed: "fast" | "default" | "slow";
22
+ }
23
+ export declare const M3ContainerTransformContext: React.Context<M3ContainerTransformContextValue | null>;
24
+ /**
25
+ * M3ContainerTransform component.
26
+ * Implements the Material 3 Container Transform motion pattern using shared element transitions.
27
+ * Use the same layoutId on both source and target containers to morph them smoothly.
28
+ */
29
+ export declare const M3ContainerTransform: React.ForwardRefExoticComponent<Omit<M3ContainerTransformProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
+ export interface M3ContainerTransformStartProps extends HTMLMotionProps<"div"> {
31
+ /**
32
+ * Overrides the active state. By default, active when isExpanded is false.
33
+ */
34
+ active?: boolean;
35
+ }
36
+ /**
37
+ * M3ContainerTransformStart component.
38
+ * Represents the starting content (e.g., Card content) inside M3ContainerTransform.
39
+ * Prevents aspect ratio distortion and fades out during the container transform morph.
40
+ */
41
+ export declare const M3ContainerTransformStart: React.ForwardRefExoticComponent<Omit<M3ContainerTransformStartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
42
+ export interface M3ContainerTransformEndProps extends HTMLMotionProps<"div"> {
43
+ /**
44
+ * Overrides the active state. By default, active when isExpanded is true.
45
+ */
46
+ active?: boolean;
47
+ }
48
+ /**
49
+ * M3ContainerTransformEnd component.
50
+ * Represents the target content (e.g., Detail page content) inside M3ContainerTransform.
51
+ * Prevents aspect ratio distortion and fades in during the container transform morph.
52
+ */
53
+ export declare const M3ContainerTransformEnd: React.ForwardRefExoticComponent<Omit<M3ContainerTransformEndProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
54
+ //# sourceMappingURL=M3ContainerTransform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"M3ContainerTransform.d.ts","sourceRoot":"","sources":["../../src/components/M3ContainerTransform.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,cAAc,CAAC;AAI7E,MAAM,WAAW,yBAA0B,SAAQ,eAAe,CAAC,KAAK,CAAC;IACvE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,2BAA2B,wDAAqE,CAAC;AAsB9G;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+GA6BhC,CAAC;AAIF,MAAM,WAAW,8BAA+B,SAAQ,eAAe,CAAC,KAAK,CAAC;IAC5E;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,oHAkCrC,CAAC;AAIF,MAAM,WAAW,4BAA6B,SAAQ,eAAe,CAAC,KAAK,CAAC;IAC1E;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,kHAmCnC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ import type { HTMLMotionProps } from "motion/react";
3
+ export interface M3FadeProps extends HTMLMotionProps<"div"> {
4
+ /**
5
+ * If true, the component will transition in. If false, it will transition out.
6
+ * If omitted, the component behaves as a standard motion element meant to be unmounted/mounted
7
+ * by an external <AnimatePresence>.
8
+ */
9
+ in?: boolean;
10
+ /**
11
+ * If true, animate the transition on initial mount.
12
+ * @default true
13
+ */
14
+ appear?: boolean;
15
+ }
16
+ /**
17
+ * M3Fade transition component.
18
+ * Fades elements in/out using Material 3 standard decelerate/accelerate curves.
19
+ */
20
+ export declare const M3Fade: React.ForwardRefExoticComponent<Omit<M3FadeProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
21
+ //# sourceMappingURL=M3Fade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"M3Fade.d.ts","sourceRoot":"","sources":["../../src/components/M3Fade.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,WAAW,WAAY,SAAQ,eAAe,CAAC,KAAK,CAAC;IACzD;;;;OAIG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,iGAwClB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import type { HTMLMotionProps, Transition } from "motion/react";
3
+ export interface M3FadeThroughProps extends HTMLMotionProps<"div"> {
4
+ /**
5
+ * Unique key representing the active view/content. Changing this key triggers the transition.
6
+ */
7
+ stateKey: React.Key;
8
+ /**
9
+ * Custom transition for the fade through animation.
10
+ */
11
+ transition?: Transition;
12
+ }
13
+ /**
14
+ * M3FadeThrough transition component.
15
+ * Implements the Material 3 Fade Through navigation pattern.
16
+ * The outgoing element fades out over 90ms, followed by the incoming element fading in and scaling up over 210ms.
17
+ */
18
+ export declare const M3FadeThrough: React.FC<M3FadeThroughProps>;
19
+ //# sourceMappingURL=M3FadeThrough.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"M3FadeThrough.d.ts","sourceRoot":"","sources":["../../src/components/M3FadeThrough.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAY,MAAM,cAAc,CAAC;AAG1E,MAAM,WAAW,kBAAmB,SAAQ,eAAe,CAAC,KAAK,CAAC;IAChE;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgDtD,CAAC"}
@@ -0,0 +1,40 @@
1
+ import * as React from "react";
2
+ import type { HTMLMotionProps } from "motion/react";
3
+ export interface M3ListStaggerProps {
4
+ /**
5
+ * Delay between each child item entering the scene (seconds).
6
+ * @default 0.05
7
+ */
8
+ staggerDelay?: number;
9
+ /**
10
+ * Delay before the stagger sequence starts (seconds).
11
+ * @default 0
12
+ */
13
+ delayChildren?: number;
14
+ /**
15
+ * If true, items animate on initial render.
16
+ * @default true
17
+ */
18
+ appear?: boolean;
19
+ className?: string;
20
+ style?: React.CSSProperties;
21
+ children?: React.ReactNode;
22
+ }
23
+ export interface M3ListStaggerItemProps extends HTMLMotionProps<"div"> {
24
+ children?: React.ReactNode;
25
+ }
26
+ /**
27
+ * M3ListStagger — stagger container for list-item enter/exit animations.
28
+ *
29
+ * Usage:
30
+ * <M3ListStagger>
31
+ * {items.map(item => <M3ListStaggerItem key={item.id}>{item.label}</M3ListStaggerItem>)}
32
+ * </M3ListStagger>
33
+ */
34
+ export declare const M3ListStagger: React.ForwardRefExoticComponent<M3ListStaggerProps & React.RefAttributes<HTMLDivElement>>;
35
+ /**
36
+ * M3ListStaggerItem — a single animated item inside M3ListStagger.
37
+ * Must be a direct or indirect descendant of M3ListStagger to inherit variants.
38
+ */
39
+ export declare const M3ListStaggerItem: React.ForwardRefExoticComponent<Omit<M3ListStaggerItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
40
+ //# sourceMappingURL=M3ListStagger.d.ts.map