@nikitph/flux-ui 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.
- package/LICENSE +21 -0
- package/README.md +310 -0
- package/dist/config/flux.config.d.ts +36 -0
- package/dist/context/FluxProvider.d.ts +11 -0
- package/dist/hooks/useAnimationBudget.d.ts +7 -0
- package/dist/hooks/useInView.d.ts +3 -0
- package/dist/hooks/useIsClient.d.ts +1 -0
- package/dist/hooks/useMergedRef.d.ts +2 -0
- package/dist/hooks/usePhysics.d.ts +7 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +1 -0
- package/dist/hooks/useReducedMotion.d.ts +1 -0
- package/dist/hooks/useScrollProgress.d.ts +2 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +3330 -0
- package/dist/index.js.map +7 -0
- package/dist/primitives/01-reveal.d.ts +22 -0
- package/dist/primitives/02-presence.d.ts +15 -0
- package/dist/primitives/03-stagger.d.ts +23 -0
- package/dist/primitives/04-text-reveal.d.ts +21 -0
- package/dist/primitives/05-count-up.d.ts +22 -0
- package/dist/primitives/06-morph-text.d.ts +19 -0
- package/dist/primitives/07-flip-card.d.ts +17 -0
- package/dist/primitives/08-collapse.d.ts +16 -0
- package/dist/primitives/09-magnetic.d.ts +14 -0
- package/dist/primitives/10-hover-scale.d.ts +16 -0
- package/dist/primitives/11-tilt.d.ts +20 -0
- package/dist/primitives/12-drag.d.ts +31 -0
- package/dist/primitives/13-swipe.d.ts +20 -0
- package/dist/primitives/14-long-press.d.ts +18 -0
- package/dist/primitives/15-hover-3d.d.ts +23 -0
- package/dist/primitives/16-scroll-velocity.d.ts +15 -0
- package/dist/primitives/17-spotlight.d.ts +17 -0
- package/dist/primitives/18-follow-cursor.d.ts +20 -0
- package/dist/primitives/19-morph.d.ts +14 -0
- package/dist/primitives/20-fluid-layout.d.ts +14 -0
- package/dist/primitives/21-reorder.d.ts +25 -0
- package/dist/primitives/22-page-transition.d.ts +16 -0
- package/dist/primitives/23-animated-list.d.ts +20 -0
- package/dist/primitives/24-marquee.d.ts +16 -0
- package/dist/primitives/25-dock.d.ts +25 -0
- package/dist/primitives/26-infinite-scroll.d.ts +21 -0
- package/dist/primitives/27-scroll-progress.d.ts +14 -0
- package/dist/primitives/28-parallax.d.ts +11 -0
- package/dist/primitives/29-sticky-scroll.d.ts +14 -0
- package/dist/primitives/30-scroll-snap.d.ts +22 -0
- package/dist/primitives/31-aurora.d.ts +12 -0
- package/dist/primitives/32-mesh-gradient.d.ts +9 -0
- package/dist/primitives/33-particles.d.ts +11 -0
- package/dist/primitives/34-grid-pattern.d.ts +10 -0
- package/dist/primitives/35-noise.d.ts +9 -0
- package/dist/primitives/36-streaming-text.d.ts +14 -0
- package/dist/primitives/37-typing-indicator.d.ts +10 -0
- package/dist/primitives/38-skeleton.d.ts +13 -0
- package/dist/primitives/39-ai-message.d.ts +13 -0
- package/dist/primitives/40-hero-highlight.d.ts +13 -0
- package/dist/utils/clamp.d.ts +1 -0
- package/dist/utils/resolveMotion.d.ts +2 -0
- package/dist/utils/slot.d.ts +4 -0
- package/package.json +86 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CREDIT IQ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/badge/FLUX_UI-v0.1.0-0d9488?style=for-the-badge&labelColor=09090b" alt="Version" />
|
|
3
|
+
<img src="https://img.shields.io/badge/React-19+-61dafb?style=for-the-badge&logo=react&labelColor=09090b" alt="React 19+" />
|
|
4
|
+
<img src="https://img.shields.io/badge/TypeScript-5.9-3178c6?style=for-the-badge&logo=typescript&labelColor=09090b" alt="TypeScript" />
|
|
5
|
+
<img src="https://img.shields.io/badge/Tailwind_CSS-v4-06b6d4?style=for-the-badge&logo=tailwindcss&labelColor=09090b" alt="Tailwind v4" />
|
|
6
|
+
<img src="https://img.shields.io/badge/License-MIT-22c55e?style=for-the-badge&labelColor=09090b" alt="MIT License" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<h1 align="center">FLUX UI</h1>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>A motion-first, physics-based React component library.</strong><br/>
|
|
13
|
+
40 composable primitives that turn animation from a feature into a language.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
18
|
+
<a href="#primitives">Primitives</a> ·
|
|
19
|
+
<a href="#physics-presets">Physics</a> ·
|
|
20
|
+
<a href="#accessibility">Accessibility</a> ·
|
|
21
|
+
<a href="#architecture">Architecture</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Why FLUX UI?
|
|
27
|
+
|
|
28
|
+
Every UI library treats animation as decoration — a per-component config you tweak until it "feels right." FLUX UI takes a different stance: **motion is a grammar.** A button's hover, a modal's entrance, a page transition, and a skeleton loader's pulse should all speak the same visual language.
|
|
29
|
+
|
|
30
|
+
FLUX UI provides that language through 40 motion primitives, a unified physics engine, and a composable architecture where wrapping `<Magnetic>` around `<Reveal>` around a `<button>` just works.
|
|
31
|
+
|
|
32
|
+
**What makes it different:**
|
|
33
|
+
|
|
34
|
+
- **Physics-first defaults** — 7 named spring presets (`snappy`, `smooth`, `gentle`, `dramatic`, `bouncy`, `cinematic`, `instant`) replace magic number configs. Every animation is driven by real stiffness, damping, and mass values.
|
|
35
|
+
- **Composable, not configurable** — Small primitives that combine like Unix pipes for motion, instead of mega-components with 50 props each.
|
|
36
|
+
- **AI-native patterns** — First-class primitives for streaming text, typing indicators, skeleton loaders, and AI chat interfaces.
|
|
37
|
+
- **Accessibility built in** — Three-tier system: OS `prefers-reduced-motion` → FluxProvider `motionLevel` → per-primitive `disabled` prop. Reduced motion never disables — it gracefully degrades to opacity crossfades.
|
|
38
|
+
- **Zero visual lock-in** — Primitives add motion behavior only. All visual styling lives in your Tailwind classes.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
### Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install flux-ui
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Peer dependencies:** `react >= 19`, `react-dom >= 19`, `motion >= 12`, `tailwindcss >= 4`
|
|
51
|
+
|
|
52
|
+
### Wrap your app
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { FluxProvider } from "flux-ui";
|
|
56
|
+
|
|
57
|
+
function App() {
|
|
58
|
+
return (
|
|
59
|
+
<FluxProvider physics="smooth" motionLevel="full">
|
|
60
|
+
{/* your app */}
|
|
61
|
+
</FluxProvider>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Use a primitive
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { Reveal, Magnetic, HoverScale } from "flux-ui";
|
|
70
|
+
|
|
71
|
+
function Hero() {
|
|
72
|
+
return (
|
|
73
|
+
<Reveal direction="up" stagger>
|
|
74
|
+
<h1>Welcome</h1>
|
|
75
|
+
<p>Motion is not a feature. It is a language.</p>
|
|
76
|
+
<Magnetic strength={0.3}>
|
|
77
|
+
<HoverScale scale={1.05}>
|
|
78
|
+
<button className="px-6 py-3 bg-teal-500 text-white rounded-xl">
|
|
79
|
+
Get Started
|
|
80
|
+
</button>
|
|
81
|
+
</HoverScale>
|
|
82
|
+
</Magnetic>
|
|
83
|
+
</Reveal>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Primitives compose freely — nest them, combine them, and let the physics engine handle the rest.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Primitives
|
|
93
|
+
|
|
94
|
+
40 motion primitives across 6 categories.
|
|
95
|
+
|
|
96
|
+
### Category A — Entrance & Exit
|
|
97
|
+
|
|
98
|
+
| # | Primitive | Description |
|
|
99
|
+
|---|-----------|-------------|
|
|
100
|
+
| 01 | `Reveal` | Fade + directional slide on viewport entry |
|
|
101
|
+
| 02 | `Presence` | Mount/unmount with enter/exit animations |
|
|
102
|
+
| 03 | `Stagger` | Sequentially animate child elements |
|
|
103
|
+
| 04 | `TextReveal` | Character or word-level text entrance |
|
|
104
|
+
| 05 | `CountUp` | Animated number counter |
|
|
105
|
+
| 06 | `MorphText` | Smooth text content transitions |
|
|
106
|
+
| 07 | `FlipCard` | 3D card flip with front/back faces |
|
|
107
|
+
| 08 | `Collapse` | Smooth height expand/collapse |
|
|
108
|
+
|
|
109
|
+
### Category B — Interaction & Gesture
|
|
110
|
+
|
|
111
|
+
| # | Primitive | Description |
|
|
112
|
+
|---|-----------|-------------|
|
|
113
|
+
| 09 | `Magnetic` | Cursor-attracted element displacement |
|
|
114
|
+
| 10 | `HoverScale` | Scale transform on hover |
|
|
115
|
+
| 11 | `Tilt` | Perspective tilt following pointer position |
|
|
116
|
+
| 12 | `Drag` | Physics-based drag with constraints |
|
|
117
|
+
| 13 | `Swipe` | Swipe-to-dismiss / swipe-to-action |
|
|
118
|
+
| 14 | `LongPress` | Press-and-hold interaction with progress |
|
|
119
|
+
| 15 | `Hover3D` | Multi-layer parallax depth on hover |
|
|
120
|
+
| 16 | `ScrollVelocity` | Speed-reactive scroll animations |
|
|
121
|
+
| 17 | `Spotlight` | Radial gradient follows cursor |
|
|
122
|
+
| 18 | `FollowCursor` | Element tracks cursor position |
|
|
123
|
+
|
|
124
|
+
### Category C — Layout & Transition
|
|
125
|
+
|
|
126
|
+
| # | Primitive | Description |
|
|
127
|
+
|---|-----------|-------------|
|
|
128
|
+
| 19 | `Morph` | Shared-layout morphing transitions |
|
|
129
|
+
| 20 | `FluidLayout` | Animated layout reflow |
|
|
130
|
+
| 21 | `Reorder` | Drag-to-reorder with animated layout |
|
|
131
|
+
| 22 | `PageTransition` | Route-level enter/exit transitions |
|
|
132
|
+
| 23 | `AnimatedList` | Auto-animate list item add/remove |
|
|
133
|
+
| 24 | `Marquee` | Infinite horizontal/vertical scroll |
|
|
134
|
+
| 25 | `Dock` | macOS-style magnifying dock |
|
|
135
|
+
| 26 | `InfiniteScroll` | Virtualized infinite scroll with motion |
|
|
136
|
+
|
|
137
|
+
### Category D — Scroll-Linked
|
|
138
|
+
|
|
139
|
+
| # | Primitive | Description |
|
|
140
|
+
|---|-----------|-------------|
|
|
141
|
+
| 27 | `ScrollProgress` | Scroll-linked progress indicator |
|
|
142
|
+
| 28 | `Parallax` | Depth-based scroll parallax layers |
|
|
143
|
+
| 29 | `StickyScroll` | Scroll-driven sticky reveal sections |
|
|
144
|
+
| 30 | `ScrollSnap` | Physics-based snap scrolling |
|
|
145
|
+
|
|
146
|
+
### Category E — Background & Ambient
|
|
147
|
+
|
|
148
|
+
| # | Primitive | Description |
|
|
149
|
+
|---|-----------|-------------|
|
|
150
|
+
| 31 | `Aurora` | Animated aurora borealis gradient |
|
|
151
|
+
| 32 | `MeshGradient` | Morphing mesh gradient background |
|
|
152
|
+
| 33 | `Particles` | Configurable particle field |
|
|
153
|
+
| 34 | `GridPattern` | Animated dot/line grid |
|
|
154
|
+
| 35 | `Noise` | Animated grain/noise texture overlay |
|
|
155
|
+
|
|
156
|
+
### Category F — AI & Streaming
|
|
157
|
+
|
|
158
|
+
| # | Primitive | Description |
|
|
159
|
+
|---|-----------|-------------|
|
|
160
|
+
| 36 | `StreamingText` | Token-by-token text reveal |
|
|
161
|
+
| 37 | `TypingIndicator` | Animated typing dots |
|
|
162
|
+
| 38 | `Skeleton` | Content placeholder with shimmer |
|
|
163
|
+
| 39 | `AIMessage` | Chat bubble with streaming support |
|
|
164
|
+
| 40 | `HeroHighlight` | Animated text emphasis highlight |
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Physics Presets
|
|
169
|
+
|
|
170
|
+
Every spring animation is driven by named physics presets — no magic numbers.
|
|
171
|
+
|
|
172
|
+
| Preset | Stiffness | Damping | Mass | Best for |
|
|
173
|
+
|--------|-----------|---------|------|----------|
|
|
174
|
+
| `snappy` | 500 | 30 | 0.5 | Buttons, toggles, micro-interactions |
|
|
175
|
+
| `smooth` | 200 | 20 | 1.0 | General transitions, reveals |
|
|
176
|
+
| `gentle` | 120 | 14 | 1.0 | Background shifts, ambient motion |
|
|
177
|
+
| `dramatic` | 80 | 10 | 1.5 | Hero entrances, page transitions |
|
|
178
|
+
| `bouncy` | 400 | 15 | 1.0 | Playful interactions, attention |
|
|
179
|
+
| `cinematic` | 50 | 12 | 2.0 | Full-screen reveals, slow drama |
|
|
180
|
+
| `instant` | 800 | 40 | 0.3 | Immediate feedback, no perceptible delay |
|
|
181
|
+
|
|
182
|
+
Override per-primitive:
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
<Reveal physics="dramatic" direction="up">
|
|
186
|
+
<h1>Grand Entrance</h1>
|
|
187
|
+
</Reveal>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Or configure globally:
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
<FluxProvider physics="smooth">
|
|
194
|
+
{/* all children default to smooth springs */}
|
|
195
|
+
</FluxProvider>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Accessibility
|
|
201
|
+
|
|
202
|
+
FLUX UI implements a three-tier accessibility strategy:
|
|
203
|
+
|
|
204
|
+
**Tier 1 — OS Level.** Automatically detects `prefers-reduced-motion` via `usePrefersReducedMotion()`. When active, all spatial animations (translate, scale, rotate) are replaced with 150ms opacity crossfades. Nothing is disabled — every primitive still communicates state changes.
|
|
205
|
+
|
|
206
|
+
**Tier 2 — Provider Level.** The `FluxProvider` accepts a `motionLevel` prop (`"full"`, `"reduced"`, `"none"`) for app-wide control, independent of OS settings.
|
|
207
|
+
|
|
208
|
+
**Tier 3 — Primitive Level.** Every primitive accepts a `disabled` prop to opt out of motion on a case-by-case basis.
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
// OS-level detection is automatic
|
|
212
|
+
// Provider-level override:
|
|
213
|
+
<FluxProvider motionLevel="reduced">
|
|
214
|
+
{/* All primitives use reduced motion */}
|
|
215
|
+
<Reveal disabled>{/* This specific one has no motion */}</Reveal>
|
|
216
|
+
</FluxProvider>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Architecture
|
|
222
|
+
|
|
223
|
+
FLUX UI is built on a five-layer architecture:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
┌─────────────────────────────────┐
|
|
227
|
+
│ Layer 5 — Scenes │ Full page compositions
|
|
228
|
+
├─────────────────────────────────┤
|
|
229
|
+
│ Layer 4 — Patterns │ Multi-primitive recipes
|
|
230
|
+
├─────────────────────────────────┤
|
|
231
|
+
│ Layer 3 — Components │ Single-purpose UI elements
|
|
232
|
+
├─────────────────────────────────┤
|
|
233
|
+
│ Layer 2 — Primitives (×40) │ Motion behaviors
|
|
234
|
+
├─────────────────────────────────┤
|
|
235
|
+
│ Layer 1 — Motion Tokens │ Physics presets, scales, config
|
|
236
|
+
└─────────────────────────────────┘
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Primitives live at Layer 2. They add **motion behavior only** — never visual styling. You bring your own design system, your own Tailwind classes, your own component library. FLUX UI handles the motion.
|
|
240
|
+
|
|
241
|
+
### Key architectural decisions
|
|
242
|
+
|
|
243
|
+
- **Radix Slot pattern** — Every primitive supports `asChild` for zero-wrapper composition.
|
|
244
|
+
- **Ref forwarding** — All 40 primitives forward refs via `React.forwardRef`.
|
|
245
|
+
- **SSR safe** — No `window` or `document` access at render time. All browser APIs live inside effects.
|
|
246
|
+
- **Tree-shakeable** — Import only what you use. Each primitive is independently importable.
|
|
247
|
+
- **< 3KB per primitive** — Every primitive targets under 3KB gzipped (excluding the `motion` peer dependency).
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Hooks
|
|
252
|
+
|
|
253
|
+
8 utility hooks available for custom motion work:
|
|
254
|
+
|
|
255
|
+
| Hook | Description |
|
|
256
|
+
|------|-------------|
|
|
257
|
+
| `usePhysics(preset)` | Returns spring config for a named preset |
|
|
258
|
+
| `usePrefersReducedMotion()` | Raw `prefers-reduced-motion` media query |
|
|
259
|
+
| `useReducedMotion()` | Computed boolean factoring provider + OS |
|
|
260
|
+
| `useIsClient()` | SSR guard — `false` on server, `true` on client |
|
|
261
|
+
| `useMergedRef(...refs)` | Merge forwarded ref + internal ref |
|
|
262
|
+
| `useInView(options)` | IntersectionObserver wrapper |
|
|
263
|
+
| `useScrollProgress(ref)` | Element scroll position as 0→1 |
|
|
264
|
+
| `useAnimationBudget()` | Register/deregister active animations |
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Tech Stack
|
|
269
|
+
|
|
270
|
+
| Layer | Technology |
|
|
271
|
+
|-------|-----------|
|
|
272
|
+
| Framework | React 19 |
|
|
273
|
+
| Animation | Motion (Framer Motion) |
|
|
274
|
+
| Styling | Tailwind CSS v4 |
|
|
275
|
+
| Composition | Radix UI Slot |
|
|
276
|
+
| Language | TypeScript 5.9 (strict) |
|
|
277
|
+
| Build | Vite 7 |
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Development
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# Install dependencies
|
|
285
|
+
npm install
|
|
286
|
+
|
|
287
|
+
# Start dev server
|
|
288
|
+
npm run dev
|
|
289
|
+
|
|
290
|
+
# Type check
|
|
291
|
+
npx tsc -b
|
|
292
|
+
|
|
293
|
+
# Build for production
|
|
294
|
+
npm run build
|
|
295
|
+
|
|
296
|
+
# Preview production build
|
|
297
|
+
npm run preview
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## License
|
|
303
|
+
|
|
304
|
+
MIT © FLUX UI
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
<p align="center">
|
|
309
|
+
<strong>Motion is not a feature. It is a language.</strong>
|
|
310
|
+
</p>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type PhysicsPreset = "snappy" | "smooth" | "gentle" | "dramatic" | "bouncy" | "cinematic" | "instant";
|
|
2
|
+
export declare const physics: Record<PhysicsPreset, {
|
|
3
|
+
type: "spring";
|
|
4
|
+
stiffness: number;
|
|
5
|
+
damping: number;
|
|
6
|
+
mass: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const motionScale: {
|
|
9
|
+
distance: {
|
|
10
|
+
xs: number;
|
|
11
|
+
sm: number;
|
|
12
|
+
md: number;
|
|
13
|
+
lg: number;
|
|
14
|
+
xl: number;
|
|
15
|
+
"2xl": number;
|
|
16
|
+
};
|
|
17
|
+
rotation: {
|
|
18
|
+
xs: number;
|
|
19
|
+
sm: number;
|
|
20
|
+
md: number;
|
|
21
|
+
lg: number;
|
|
22
|
+
xl: number;
|
|
23
|
+
};
|
|
24
|
+
scale: {
|
|
25
|
+
xs: number;
|
|
26
|
+
sm: number;
|
|
27
|
+
md: number;
|
|
28
|
+
lg: number;
|
|
29
|
+
};
|
|
30
|
+
stagger: {
|
|
31
|
+
fast: number;
|
|
32
|
+
normal: number;
|
|
33
|
+
slow: number;
|
|
34
|
+
cascade: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export type MotionLevel = "full" | "reduced" | "none";
|
|
3
|
+
interface FluxContextProps {
|
|
4
|
+
motionLevel?: MotionLevel;
|
|
5
|
+
}
|
|
6
|
+
export declare function FluxProvider({ children, motionLevel, }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
motionLevel?: MotionLevel;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function useFluxContext(): FluxContextProps;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsClient(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePrefersReducedMotion(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useReducedMotion(): boolean;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export * from "./config/flux.config";
|
|
2
|
+
export * from "./context/FluxProvider";
|
|
3
|
+
export * from "./hooks/usePhysics";
|
|
4
|
+
export * from "./hooks/usePrefersReducedMotion";
|
|
5
|
+
export * from "./hooks/useReducedMotion";
|
|
6
|
+
export * from "./hooks/useIsClient";
|
|
7
|
+
export * from "./hooks/useMergedRef";
|
|
8
|
+
export * from "./hooks/useInView";
|
|
9
|
+
export * from "./hooks/useScrollProgress";
|
|
10
|
+
export * from "./hooks/useAnimationBudget";
|
|
11
|
+
export * from "./utils/resolveMotion";
|
|
12
|
+
export * from "./utils/slot";
|
|
13
|
+
export * from "./utils/clamp";
|
|
14
|
+
export * from "./primitives/01-reveal";
|
|
15
|
+
export * from "./primitives/02-presence";
|
|
16
|
+
export * from "./primitives/03-stagger";
|
|
17
|
+
export * from "./primitives/04-text-reveal";
|
|
18
|
+
export * from "./primitives/05-count-up";
|
|
19
|
+
export * from "./primitives/06-morph-text";
|
|
20
|
+
export * from "./primitives/07-flip-card";
|
|
21
|
+
export * from "./primitives/08-collapse";
|
|
22
|
+
export * from "./primitives/09-magnetic";
|
|
23
|
+
export * from "./primitives/10-hover-scale";
|
|
24
|
+
export * from "./primitives/11-tilt";
|
|
25
|
+
export * from "./primitives/12-drag";
|
|
26
|
+
export * from "./primitives/13-swipe";
|
|
27
|
+
export * from "./primitives/14-long-press";
|
|
28
|
+
export * from "./primitives/15-hover-3d";
|
|
29
|
+
export * from "./primitives/16-scroll-velocity";
|
|
30
|
+
export * from "./primitives/17-spotlight";
|
|
31
|
+
export * from "./primitives/18-follow-cursor";
|
|
32
|
+
export * from "./primitives/19-morph";
|
|
33
|
+
export * from "./primitives/20-fluid-layout";
|
|
34
|
+
export * from "./primitives/21-reorder";
|
|
35
|
+
export * from "./primitives/22-page-transition";
|
|
36
|
+
export * from "./primitives/23-animated-list";
|
|
37
|
+
export * from "./primitives/24-marquee";
|
|
38
|
+
export * from "./primitives/25-dock";
|
|
39
|
+
export * from "./primitives/26-infinite-scroll";
|
|
40
|
+
export * from "./primitives/27-scroll-progress";
|
|
41
|
+
export * from "./primitives/28-parallax";
|
|
42
|
+
export * from "./primitives/29-sticky-scroll";
|
|
43
|
+
export * from "./primitives/30-scroll-snap";
|
|
44
|
+
export * from "./primitives/31-aurora";
|
|
45
|
+
export * from "./primitives/32-mesh-gradient";
|
|
46
|
+
export * from "./primitives/33-particles";
|
|
47
|
+
export * from "./primitives/34-grid-pattern";
|
|
48
|
+
export * from "./primitives/35-noise";
|
|
49
|
+
export * from "./primitives/36-streaming-text";
|
|
50
|
+
export * from "./primitives/37-typing-indicator";
|
|
51
|
+
export * from "./primitives/38-skeleton";
|
|
52
|
+
export * from "./primitives/39-ai-message";
|
|
53
|
+
export * from "./primitives/40-hero-highlight";
|