nexi-agent 0.1.0 → 0.2.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
@@ -4,6 +4,8 @@
4
4
  answers, reasoning traces, tool calls, approvals, task progress, data tables and
5
5
  more. You install them, import them, and pass in your own data.
6
6
 
7
+ **[Browse every component live →](https://nexi-agent-component-package.vercel.app)** (previews, copyable code and props)
8
+
7
9
  ```tsx
8
10
  <ThinkingState done="Thought for 3 seconds" rows={[{ primary: "Reading the ticket" }]} />
9
11
  <StreamingText content="The deploy failed because the API key expired." />
@@ -39,7 +41,7 @@ more. You install them, import them, and pass in your own data.
39
41
  ## 1. Quick start
40
42
 
41
43
  ```bash
42
- npm install github:abiramavarshini-kl/nexi-agent-component-package
44
+ npm install nexi-agent
43
45
  ```
44
46
 
45
47
  ```tsx
@@ -61,8 +63,8 @@ import { StreamingText } from "nexi-agent";
61
63
  <StreamingText content="Hello! I'm your agent." />;
62
64
  ```
63
65
 
64
- That's all. To see every component with sample data first, run the
65
- [playground](#the-playground).
66
+ That's all. To see every component with sample data first, open the
67
+ [docs site](https://nexi-agent-component-package.vercel.app).
66
68
 
67
69
  ---
68
70
 
@@ -77,8 +79,8 @@ That's all. To see every component with sample data first, run the
77
79
 
78
80
  | From | Command | When |
79
81
  | --- | --- | --- |
80
- | **Git** | `npm install github:abiramavarshini-kl/nexi-agent-component-package` (add `#main` or `#v0.1.0` to pin) | the normal way, until it's on npm. npm builds the package on install. |
81
- | **npm** | `npm install nexi-agent` | once it's published |
82
+ | **npm** | `npm install nexi-agent` | the normal way |
83
+ | **Git** | `npm install github:kaaylabs-v2/nexi-components` (add `#main` or `#v0.1.0` to pin) | an unreleased commit or branch. npm builds the package on install. |
82
84
  | **A local file** | in this repo: `npm run build && npm pack`, then in your app: `npm install ../path/nexi-agent-0.1.0.tgz` | testing unreleased changes in another app |
83
85
 
84
86
  ### Styles: pick one
@@ -170,6 +172,160 @@ components straight into App Router pages. Put the CSS import in `app/layout.tsx
170
172
  | `FineTuneCard` | an inspector with draggable number fields |
171
173
  | `GlideMenu` | a menu with a gliding hover highlight |
172
174
 
175
+ ### Effects
176
+
177
+ Animated pieces for landing pages, dashboards and agent shells. They use the same
178
+ tokens, so they follow your theme and dark mode, add no dependencies, and respect
179
+ `prefers-reduced-motion`.
180
+
181
+ | Component | What it shows |
182
+ | --- | --- |
183
+ | `MovingBorder` | a button with a glow travelling around its border |
184
+ | `HoverBorderGradient` | a pill with an orbiting border highlight that floods with accent on hover |
185
+ | `StatefulButton` | a button that shows loading, then success or error, from the promise `onClick` returns |
186
+ | `EncryptedText` | text that scrambles through random glyphs before locking in |
187
+ | `FlipWords` | cycles words inside a sentence with a blur-in, drift-out transition |
188
+ | `Typewriter` | types styled words behind a blinking caret, optionally looping |
189
+ | `SpotlightCard` | a card with a pointer-following light that reveals a dot pattern |
190
+ | `GlareCard` | a card that tilts toward the pointer with a glare and holographic sheen |
191
+ | `AnimatedTooltip` | an avatar stack whose tooltips swing with the pointer |
192
+ | `Meteors` | a card with meteors streaking across its background |
193
+ | `GridBackground` | a grid, small-grid or dot background that fades at the edges |
194
+ | `FileUpload` | a drop zone with a lifting upload tile and file detail cards |
195
+ | `FloatingDock` | a dock whose icons magnify as the pointer approaches |
196
+ | `AnimatedTabs` | tabs with a gliding pill and a stacked deck of panels |
197
+ | `BentoGrid` / `BentoGridItem` | a responsive grid of feature tiles; tiles can span columns |
198
+ | `Timeline` | entries with sticky titles and a beam that fills as you scroll |
199
+ | `AuroraBackground` | soft bands of colour drifting behind the content |
200
+ | `BackgroundBeams` | a fan of faint curved lines with pulses of colour racing along them |
201
+ | `Sparkles` | a canvas of tiny particles that twinkle and drift |
202
+ | `LampEffect` | a bar of light that switches on and throws a cone onto the heading |
203
+ | `Card3D` / `Card3DItem` | a card that turns toward the pointer while its layers lift off by their own depth |
204
+ | `InfiniteMovingCards` | quote cards scrolling in an endless loop, paused on hover |
205
+ | `NavbarMenu` | a pill nav with one dropdown panel that glides between items |
206
+ | `AnimatedModal` | a trigger whose label slides to an icon, opening a modal that tips into place |
207
+ | `LinkPreview` | an inline link that springs up a preview card on hover |
208
+ | `ImagesSlider` | a full-bleed slideshow with content on top, autoplay, arrows and dots |
209
+ | `CardsCarousel` | a sideways-scrolling row of story cards that open into a modal |
210
+ | `AnimatedTestimonials` | a loose photo stack beside a quote whose words blur into focus |
211
+ | `BackgroundGradient` | a frame of colour that slowly turns around any content, with a glow that brightens on hover |
212
+ | `BackgroundGradientAnimation` | large blurred orbs drifting over a gradient field, one trailing the pointer |
213
+ | `WavyBackground` | ribbons of colour undulating across a canvas |
214
+ | `BackgroundBoxes` | a perspective floor of tiles that light up as the pointer passes |
215
+ | `BeamsWithCollision` | streaks of light falling and bursting into sparks on the floor |
216
+ | `BackgroundLines` | long flowing curves that draw themselves in colour |
217
+ | `BackgroundRippleEffect` | a grid where a click sends a ring of light spreading out |
218
+ | `DottedGlowBackground` | a grid of faint dots, some breathing with a coloured glow |
219
+ | `GlowingStars` | a card topped with a field of stars that flare up; hover sweeps light across them |
220
+ | `ShootingStars` | a night sky of twinkling stars with shooting stars streaking across |
221
+ | `Vortex` | glowing particles swirling around the centre, leaving light trails |
222
+ | `BackgroundCubesGrid` | a floor of cubes that rise toward the pointer |
223
+ | `Spotlight` | a beam of light that swings in from a corner and settles across the content |
224
+ | `SpotlightNew` | two banks of soft stage lights swaying from the top corners |
225
+ | `CanvasRevealEffect` | a card that floods with a matrix of glowing dots on hover |
226
+ | `SvgMaskEffect` | a lens that follows the pointer and reveals a second layer of content |
227
+ | `TracingBeam` | a rail beside long content with a beam that traces along as you scroll |
228
+ | `GlowingEffect` | an arc of colour on a card's border that follows the nearby pointer |
229
+ | `ScrollPathsEffect` | ribbons of colour that draw in and converge as you scroll (our take on the Google Gemini Effect) |
230
+ | `Scales` | a panel framed by rulers whose ticks react to the pointer |
231
+ | `ImagesBadge` | a pill badge whose thumbnails fan out on hover |
232
+ | `ParallaxHeroImages` | pictures floating around a headline at different depths, shifting with the pointer |
233
+ | `ChromaticImage` | an image whose colour channels split apart toward the pointer |
234
+ | `LiquidGlass` | a frosted, edge-refracting glass pane for any colourful background |
235
+ | `ImageGenerationLoader` | an image that develops from blurry grain to sharp behind a scan line, with a live percentage |
236
+ | `DitherShader` | retro ordered dithering of a moving plasma field or any image, drawn on a plain canvas |
237
+ | `Marquee3D` | a tilted wall of pictures whose columns drift in opposite directions |
238
+
239
+ ### Cards
240
+
241
+ | Component | What it shows |
242
+ | --- | --- |
243
+ | `CardHoverEffect` | a grid of link cards with one highlight that slides between them |
244
+ | `CardStack` | a deck of cards where the top one slips to the back every few seconds or on click |
245
+ | `WobbleCard` | a bold card that leans after the pointer while its content drifts the other way |
246
+ | `FocusCards` | picture cards where hovering one blurs the rest and reveals its title |
247
+ | `ExpandableCard` | a list of rows that each grow into a full detail card |
248
+ | `DraggableCards` | picture cards you can pick up, fling and drop on a table |
249
+ | `CometCard` | a weighty card that tips toward the pointer with a streak of light across it |
250
+ | `CipherCard` | a card of scrambled characters revealed in a glow around the pointer (our take on the Evervault Card) |
251
+ | `DirectionAwareHover` | a picture card whose caption slides in from the edge the pointer entered |
252
+ | `TooltipCard` | inline text that floats a rich card beside the pointer |
253
+ | `Keyboard` | an on-screen keyboard whose keys sink on click or real key presses |
254
+ | `Terminal` | a terminal window that plays back a typed session with output |
255
+ | `AsciiArt` | any image turned into character art, typed in row by row |
256
+ | `PixelatedCanvas` | an image as chunky pixels that the pointer pushes aside |
257
+ | `CloudShader` | soft clouds drifting across a sky, drawn on a canvas (a lightweight stand-in for a shader) |
258
+ | `WebcamPixelGrid` | the viewer's camera as a grid of dots, after they click to start |
259
+ | `Carousel3D` | picture slides in a row; the current one tilts toward the pointer while its neighbours fall back |
260
+ | `LayoutGrid` | a mosaic of pictures where the chosen one grows out of the grid to tell its story |
261
+ | `Pin3D` | a card that tips back on hover as a beam rises with ripples and a link tag |
262
+ | `Compare` | two images with a glowing divider to drag, hover or auto-sweep between them |
263
+
264
+ ### Scroll and parallax
265
+
266
+ | Component | What it shows |
267
+ | --- | --- |
268
+ | `ParallaxScroll` | a three-column photo wall whose columns drift apart as you scroll |
269
+ | `StickyScrollReveal` | scrolling sections beside a pinned panel that swaps to match the one in focus |
270
+ | `LaptopScroll` | a CSS-drawn laptop whose lid opens and screen grows as you scroll (our take on Macbook Scroll) |
271
+ | `ContainerScrollAnimation` | a device frame that rises from tipped-back to upright as you scroll |
272
+ | `HeroParallax` | a headline over rows of product shots that straighten and glide sideways on scroll |
273
+
274
+ ### Text
275
+
276
+ | Component | What it shows |
277
+ | --- | --- |
278
+ | `TextHoverEffect` | a huge outlined word that draws itself in and glows in colour under the pointer |
279
+ | `HeroHighlight` / `Highlight` | a dot-grid hero that brightens around the pointer, with a marker-sweep Highlight for key words |
280
+ | `TextRevealCard` | a card whose muted line wipes into a bright second line under the pointer |
281
+ | `ContainerTextFlip` | a word in a raised box that resizes as it flips to the next word |
282
+ | `LayoutTextFlip` | a fixed phrase with a word card that flips upward and resizes smoothly |
283
+ | `ColourfulText` | letters in many colours that reshuffle with a hopping ripple |
284
+ | `SquigglyText` | text that wobbles like a hand-drawn cartoon, via an SVG noise filter |
285
+ | `CanvasText` | big lettering filled with flowing bands of colour drawn on a canvas |
286
+ | `TextFlippingBoard` | a split-flap board whose tiles riffle to each new message |
287
+ | `ContainerCover` | a framed word that hits warp speed on hover, with racing light streaks |
288
+ | `PointerHighlight` | a selection box drawn around words by a cursor as they scroll into view |
289
+
290
+ ### Buttons
291
+
292
+ | Component | What it shows |
293
+ | --- | --- |
294
+ | `EffectButton` | one button, nine CSS effects: shimmer, glow, sketch, lift, outline, gradient, invert, spotlight and arrow |
295
+ | `MagneticButton` | a button that leans toward the pointer, with a label that leans a little further |
296
+ | `NoiseBackground` | drifting colour washes under film grain, as a fill or a glowing rim |
297
+
298
+ ### Navigation
299
+
300
+ | Component | What it shows |
301
+ | --- | --- |
302
+ | `FloatingNavbar` | a pill nav that hides while you scroll down and returns when you scroll up |
303
+ | `ResizableNavbar` | a full-width header that tucks into a frosted floating bar on scroll, with a mobile menu |
304
+ | `StickyBanner` | an announcement strip pinned to the top that slides away on scroll and folds shut when dismissed |
305
+ | `Notch` | a black status pill that springs open into a detail panel |
306
+
307
+ ### Inputs
308
+
309
+ | Component | What it shows |
310
+ | --- | --- |
311
+ | `SignupForm` / `GlowInput` | a sign-up card whose fields glow around the pointer, with provider buttons |
312
+ | `GooeyInput` | a round search button that stretches into a field like a drop of liquid |
313
+
314
+ ### Pointer
315
+
316
+ | Component | What it shows |
317
+ | --- | --- |
318
+ | `FollowingPointer` | a custom arrow with a name tag that replaces the cursor inside an area |
319
+ | `Lens` | a round magnifier that shows a zoomed copy of any content under the pointer |
320
+
321
+ ### Maps and globes
322
+
323
+ | Component | What it shows |
324
+ | --- | --- |
325
+ | `WorldMap` | a dotted world map with arcs that draw themselves between places |
326
+ | `ArcGlobe` | a night-side globe with arcs streaking between cities and ripples where they land |
327
+ | `Globe` | a dotted, lit 3D globe with glowing markers that you can spin |
328
+
173
329
  ### Atoms (small building blocks)
174
330
 
175
331
  `Avatar` · `Badge` · `Button` · `Chip` · `EntityChip` · `Monogram` ·
@@ -237,6 +393,27 @@ so you can handle plurals:
237
393
  | `Dialog` | `onConfirm()` (async is fine; return `false` to keep it open), `onOpenChange` |
238
394
  | `Flowchart` | `onConditionChange`, `onSelect` |
239
395
  | `Markdown` | `onLinkClick(href)`, `onCopyCode(code)` |
396
+ | `StatefulButton` | `onClick(e)`: return a promise to drive the loading → success / error states |
397
+ | `FileUpload` | `onChange(files)` |
398
+ | `AnimatedTabs` | `onValueChange(value)` |
399
+ | `AnimatedModal` | `onOpenChange(open)`; `footer` can be a function that receives `close` |
400
+ | `NavbarMenu` | `onNavigate(href, event)` |
401
+ | `CardsCarousel` | `onOpen(card, index)` |
402
+ | `BackgroundRippleEffect` | `onCellClick(row, col)` |
403
+ | `ImagesBadge` | `onClick()` (or pass `href`) |
404
+ | `CardHoverEffect`, `FocusCards` | `onSelect(item, index)` |
405
+ | `ExpandableCard` | `onOpen(item, index)` |
406
+ | `Keyboard` | `onKeyPress(key)` |
407
+ | `FloatingNavbar`, `ResizableNavbar` | `onNavigate(href, event)` |
408
+ | `StickyBanner` | `onClose()` |
409
+ | `Notch` | `onExpandedChange(expanded)` |
410
+ | `SignupForm` | `onSubmit(values, event)`, `onProvider(id)` |
411
+ | `GooeyInput` | `onChange(value)`, `onSubmit(value)` |
412
+ | `ImageGenerationLoader` | `onComplete()` |
413
+ | `Carousel3D` | `onAction(slide, index)`, `onIndexChange(index)` |
414
+ | `LayoutGrid` | `onSelect(card, index)` (both `null` when closed) |
415
+ | `Compare` | `onChange(position)` |
416
+ | `Pin3D` | `onClick(event)` (or pass `href`) |
240
417
 
241
418
  ### ④ Sample data lives in `nexi-agent/demo`
242
419
 
@@ -425,7 +602,7 @@ Use the `labels` prop on any component (see [②](#-ui-words-go-in-labels)).
425
602
  ### Get going
426
603
 
427
604
  ```bash
428
- git clone https://github.com/abiramavarshini-kl/nexi-agent-component-package.git nexi-agent
605
+ git clone https://github.com/kaaylabs-v2/nexi-components.git nexi-agent
429
606
  cd nexi-agent
430
607
  npm install # installs and builds dist/
431
608
  npm run playground # opens the docs site at http://localhost:5173
@@ -488,6 +665,7 @@ You only need `npm pack` to try the package in a separate app.
488
665
  src/
489
666
  atoms/ small building blocks (Badge, Button, Avatar, Tooltip…)
490
667
  primitives/ the main components (ApprovalCard, PromptBar, MessageThread…)
668
+ effects/ animated pieces (MovingBorder, SpotlightCard, Timeline…)
491
669
  provider/ NexiProvider
492
670
  demo/ sample data for every component → "nexi-agent/demo"
493
671
  lib/ cn() class helper, icon shims
@@ -504,8 +682,9 @@ vercel.json Vercel build settings for the docs site
504
682
 
505
683
  ### Adding a component
506
684
 
507
- 1. Create `src/primitives/MyThing.tsx` with `export default function MyThing(props)`,
508
- or `src/atoms/MyThing.tsx` with a named export.
685
+ 1. Create `src/primitives/MyThing.tsx` (or `src/effects/MyThing.tsx` for an animated
686
+ piece) with `export default function MyThing(props)`, or `src/atoms/MyThing.tsx`
687
+ with a named export.
509
688
  2. Follow the conventions: content props default to empty, UI words go in
510
689
  `labels`, user actions go out through callbacks, the outer element accepts
511
690
  `className`, and you export a `MyThingProps` type.
@@ -553,23 +732,19 @@ docker build --target test -t nexi-agent-test . # build + smoke test onl
553
732
 
554
733
  ## 9. Releasing
555
734
 
556
- **Via Git** (what teammates install with `npm install github:abiramavarshini-kl/nexi-agent-component-package`):
735
+ The package is on npm as [`nexi-agent`](https://www.npmjs.com/package/nexi-agent).
736
+ To release a new version:
557
737
 
558
738
  ```bash
559
739
  npm version patch # 0.1.0 → 0.1.1; use minor / major for bigger changes
560
- git push --follow-tags # teammates pin with github:abiramavarshini-kl/nexi-agent-component-package#v0.1.1
561
- ```
562
-
563
- **Via npm:**
564
-
565
- ```bash
566
- npm login
567
- npm publish # runs typecheck + build first
568
- # scoped to your organisation: set "name": "@kaaylabs/nexi-agent", then
569
- npm publish --access public # or --access restricted (paid npm plan)
740
+ git push --follow-tags # pushes the commit and the v0.1.1 tag
741
+ npm login # once per machine
742
+ npm publish # runs typecheck + build, then asks you to confirm with 2FA
570
743
  ```
571
744
 
572
- A version number can't be published twice. Bump it with `npm version` each time.
745
+ A version number can't be published twice, so bump it with `npm version` each time.
746
+ Publishing needs 2FA on the npm account. The docs site redeploys from `main` on
747
+ its own, so there's nothing to do there.
573
748
 
574
749
  ---
575
750
 
@@ -925,6 +925,273 @@ function ThinkingState({
925
925
  );
926
926
  }
927
927
 
928
+ // src/effects/Card3D.tsx
929
+ import {
930
+ createContext,
931
+ useContext,
932
+ useRef as useRef3,
933
+ useState as useState5
934
+ } from "react";
935
+
936
+ // src/effects/hooks.ts
937
+ import { useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
938
+ function useReducedMotion() {
939
+ const [reduce, setReduce] = useState4(false);
940
+ useEffect3(() => {
941
+ if (typeof window === "undefined" || !window.matchMedia) return;
942
+ const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
943
+ setReduce(mq.matches);
944
+ const onChange = (e) => setReduce(e.matches);
945
+ mq.addEventListener("change", onChange);
946
+ return () => mq.removeEventListener("change", onChange);
947
+ }, []);
948
+ return reduce;
949
+ }
950
+ function useInViewOnce(ref, rootMargin = "0px") {
951
+ const [seen, setSeen] = useState4(false);
952
+ useEffect3(() => {
953
+ const el = ref.current;
954
+ if (!el || seen) return;
955
+ if (typeof IntersectionObserver === "undefined") {
956
+ setSeen(true);
957
+ return;
958
+ }
959
+ const io = new IntersectionObserver(
960
+ (entries) => {
961
+ if (entries.some((e) => e.isIntersecting)) {
962
+ setSeen(true);
963
+ io.disconnect();
964
+ }
965
+ },
966
+ { rootMargin }
967
+ );
968
+ io.observe(el);
969
+ return () => io.disconnect();
970
+ }, [ref, rootMargin, seen]);
971
+ return seen;
972
+ }
973
+ function clamp(v, min, max) {
974
+ return Math.min(max, Math.max(min, v));
975
+ }
976
+ function mapRange(v, inMin, inMax, outMin, outMax) {
977
+ const t = clamp((v - inMin) / (inMax - inMin), 0, 1);
978
+ return outMin + (outMax - outMin) * t;
979
+ }
980
+ function useCanvasScene(ref, create, deps, { animate = true } = {}) {
981
+ const reduce = useReducedMotion();
982
+ const createRef = useRef2(create);
983
+ createRef.current = create;
984
+ useEffect3(() => {
985
+ const canvas = ref.current;
986
+ const ctx = canvas?.getContext("2d");
987
+ if (!canvas || !ctx) return;
988
+ const scene = createRef.current(ctx, canvas);
989
+ const still = reduce || !animate;
990
+ let w = 0;
991
+ let h = 0;
992
+ let frame = 0;
993
+ const start = performance.now();
994
+ const resize = () => {
995
+ const dpr = Math.min(window.devicePixelRatio || 1, 2);
996
+ w = canvas.clientWidth;
997
+ h = canvas.clientHeight;
998
+ canvas.width = Math.max(1, Math.round(w * dpr));
999
+ canvas.height = Math.max(1, Math.round(h * dpr));
1000
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
1001
+ scene.resize?.(w, h);
1002
+ if (still) scene.frame(0, w, h);
1003
+ };
1004
+ const loop = (now) => {
1005
+ scene.frame(now - start, w, h);
1006
+ frame = requestAnimationFrame(loop);
1007
+ };
1008
+ resize();
1009
+ const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(resize) : null;
1010
+ ro?.observe(canvas);
1011
+ if (!still) frame = requestAnimationFrame(loop);
1012
+ return () => {
1013
+ cancelAnimationFrame(frame);
1014
+ ro?.disconnect();
1015
+ };
1016
+ }, [ref, reduce, animate, ...deps]);
1017
+ }
1018
+ function readCssColor(el, variable) {
1019
+ const style = getComputedStyle(el);
1020
+ return variable && style.getPropertyValue(variable).trim() || style.color;
1021
+ }
1022
+ function seeded(seed) {
1023
+ let s = seed >>> 0 || 1;
1024
+ return () => {
1025
+ s ^= s << 13;
1026
+ s ^= s >>> 17;
1027
+ s ^= s << 5;
1028
+ return (s >>> 0) % 1e5 / 1e5;
1029
+ };
1030
+ }
1031
+ function useScrollProgress(ref, mode = "through") {
1032
+ const [progress, setProgress] = useState4(0);
1033
+ useEffect3(() => {
1034
+ const el = ref.current;
1035
+ if (!el) return;
1036
+ let frame = 0;
1037
+ const measure = () => {
1038
+ frame = 0;
1039
+ const r = el.getBoundingClientRect();
1040
+ const vh = window.innerHeight;
1041
+ const p = mode === "pinned" ? -r.top / Math.max(1, r.height - vh) : (vh - r.top) / Math.max(1, vh + r.height);
1042
+ setProgress(clamp(p, 0, 1));
1043
+ };
1044
+ const schedule = () => {
1045
+ if (!frame) frame = requestAnimationFrame(measure);
1046
+ };
1047
+ measure();
1048
+ window.addEventListener("scroll", schedule, { passive: true, capture: true });
1049
+ window.addEventListener("resize", schedule);
1050
+ return () => {
1051
+ cancelAnimationFrame(frame);
1052
+ window.removeEventListener("scroll", schedule, { capture: true });
1053
+ window.removeEventListener("resize", schedule);
1054
+ };
1055
+ }, [ref, mode]);
1056
+ return progress;
1057
+ }
1058
+ function useAnyScroll(onScroll) {
1059
+ const cb = useRef2(onScroll);
1060
+ cb.current = onScroll;
1061
+ useEffect3(() => {
1062
+ let frame = 0;
1063
+ let prev = window.scrollY;
1064
+ const handle = (e) => {
1065
+ const t = e.target;
1066
+ const y = t instanceof Element ? t.scrollTop : window.scrollY;
1067
+ cancelAnimationFrame(frame);
1068
+ frame = requestAnimationFrame(() => {
1069
+ cb.current(y, prev);
1070
+ prev = y;
1071
+ });
1072
+ };
1073
+ window.addEventListener("scroll", handle, { capture: true, passive: true });
1074
+ return () => {
1075
+ cancelAnimationFrame(frame);
1076
+ window.removeEventListener("scroll", handle, { capture: true });
1077
+ };
1078
+ }, []);
1079
+ }
1080
+
1081
+ // src/effects/Card3D.tsx
1082
+ import { jsx as jsx7 } from "react/jsx-runtime";
1083
+ var HoverContext = createContext(false);
1084
+ function Card3D({ children, maxTilt = 14, containerClassName, className }) {
1085
+ const ref = useRef3(null);
1086
+ const reduce = useReducedMotion();
1087
+ const [hover, setHover] = useState5(false);
1088
+ const move = (e) => {
1089
+ const el = ref.current;
1090
+ if (!el || reduce) return;
1091
+ const r = el.getBoundingClientRect();
1092
+ const x = (e.clientX - r.left) / r.width - 0.5;
1093
+ const y = (e.clientY - r.top) / r.height - 0.5;
1094
+ el.style.transform = `rotateY(${x * maxTilt * 2}deg) rotateX(${-y * maxTilt * 2}deg)`;
1095
+ };
1096
+ const leave = () => {
1097
+ setHover(false);
1098
+ if (ref.current) ref.current.style.transform = "rotateY(0deg) rotateX(0deg)";
1099
+ };
1100
+ return /* @__PURE__ */ jsx7("div", { className: cn("flex items-center justify-center [perspective:1000px]", containerClassName), children: /* @__PURE__ */ jsx7(
1101
+ "div",
1102
+ {
1103
+ ref,
1104
+ onPointerEnter: () => setHover(true),
1105
+ onPointerMove: move,
1106
+ onPointerLeave: leave,
1107
+ className: cn("relative [transform-style:preserve-3d]", className),
1108
+ style: { transition: "transform 200ms ease-out", willChange: "transform" },
1109
+ children: /* @__PURE__ */ jsx7(HoverContext.Provider, { value: hover && !reduce, children })
1110
+ }
1111
+ ) });
1112
+ }
1113
+ function Card3DItem({
1114
+ children,
1115
+ as: Tag = "div",
1116
+ translateZ = 0,
1117
+ translateX = 0,
1118
+ translateY = 0,
1119
+ rotateX = 0,
1120
+ rotateY = 0,
1121
+ rotateZ = 0,
1122
+ className,
1123
+ style
1124
+ }) {
1125
+ const hover = useContext(HoverContext);
1126
+ return /* @__PURE__ */ jsx7(
1127
+ Tag,
1128
+ {
1129
+ className: cn("[transform-style:preserve-3d]", className),
1130
+ style: {
1131
+ ...style,
1132
+ transform: hover ? `translate3d(${translateX}px, ${translateY}px, ${translateZ}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)` : "translate3d(0, 0, 0)",
1133
+ transition: "transform 300ms cubic-bezier(0.23, 1, 0.32, 1)"
1134
+ },
1135
+ children
1136
+ }
1137
+ );
1138
+ }
1139
+
1140
+ // src/effects/HeroHighlight.tsx
1141
+ import { useRef as useRef4 } from "react";
1142
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1143
+ var dots = (color) => ({
1144
+ backgroundImage: `radial-gradient(${color} 1px, transparent 1px)`,
1145
+ backgroundSize: "16px 16px"
1146
+ });
1147
+ function HeroHighlight({ children, radius = 160, containerClassName, className }) {
1148
+ const ref = useRef4(null);
1149
+ const mask = `radial-gradient(${radius}px circle at var(--nx-hh-x, -999px) var(--nx-hh-y, -999px), #000, transparent 100%)`;
1150
+ return /* @__PURE__ */ jsxs6(
1151
+ "div",
1152
+ {
1153
+ ref,
1154
+ onPointerMove: (e) => {
1155
+ const r = ref.current?.getBoundingClientRect();
1156
+ if (!r || !ref.current) return;
1157
+ ref.current.style.setProperty("--nx-hh-x", `${e.clientX - r.left}px`);
1158
+ ref.current.style.setProperty("--nx-hh-y", `${e.clientY - r.top}px`);
1159
+ },
1160
+ onPointerLeave: () => {
1161
+ ref.current?.style.setProperty("--nx-hh-x", "-999px");
1162
+ ref.current?.style.setProperty("--nx-hh-y", "-999px");
1163
+ },
1164
+ className: cn("relative flex min-h-80 w-full items-center justify-center overflow-hidden rounded-window bg-page", containerClassName),
1165
+ children: [
1166
+ /* @__PURE__ */ jsx8("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0", style: { ...dots("var(--line-strong)") } }),
1167
+ /* @__PURE__ */ jsx8("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0", style: { ...dots("var(--accent)"), maskImage: mask, WebkitMaskImage: mask } }),
1168
+ /* @__PURE__ */ jsx8("div", { className: cn("relative z-10 px-6", className), children })
1169
+ ]
1170
+ }
1171
+ );
1172
+ }
1173
+ function Highlight({ children, colors = ["#c4b5fd", "#93c5fd"], duration = 1.6, className }) {
1174
+ const ref = useRef4(null);
1175
+ const seen = useInViewOnce(ref);
1176
+ const reduce = useReducedMotion();
1177
+ const done = seen || reduce;
1178
+ return /* @__PURE__ */ jsx8(
1179
+ "span",
1180
+ {
1181
+ ref,
1182
+ className: cn("relative inline rounded-[8px] px-1 pb-0.5 [box-decoration-break:clone] [-webkit-box-decoration-break:clone]", className),
1183
+ style: {
1184
+ backgroundImage: `linear-gradient(to right, ${colors[0]}, ${colors[1]})`,
1185
+ backgroundRepeat: "no-repeat",
1186
+ backgroundPosition: "left center",
1187
+ backgroundSize: done ? "100% 100%" : "0% 100%",
1188
+ transition: reduce ? void 0 : `background-size ${duration}s cubic-bezier(0.65, 0, 0.35, 1) 0.4s`
1189
+ },
1190
+ children
1191
+ }
1192
+ );
1193
+ }
1194
+
928
1195
  // src/lib/icons.tsx
929
1196
  import {
930
1197
  Check,
@@ -940,10 +1207,10 @@ import {
940
1207
  UserPlus,
941
1208
  Xmark
942
1209
  } from "iconoir-react";
943
- import { jsx as jsx7 } from "react/jsx-runtime";
1210
+ import { jsx as jsx9 } from "react/jsx-runtime";
944
1211
  function wrap(Icon) {
945
1212
  return function NexiIcon({ size = 18, className }) {
946
- return /* @__PURE__ */ jsx7(Icon, { width: size, height: size, strokeWidth: 1.8, className, "aria-hidden": true });
1213
+ return /* @__PURE__ */ jsx9(Icon, { width: size, height: size, strokeWidth: 1.8, className, "aria-hidden": true });
947
1214
  };
948
1215
  }
949
1216
  var IconArrowBoxLeft = wrap(LogOut);
@@ -984,6 +1251,19 @@ export {
984
1251
  IconSettingsGear1,
985
1252
  IconSidebarLeftArrow,
986
1253
  IconUserAdd,
987
- ThinkingState
1254
+ ThinkingState,
1255
+ useReducedMotion,
1256
+ useInViewOnce,
1257
+ clamp,
1258
+ mapRange,
1259
+ useCanvasScene,
1260
+ readCssColor,
1261
+ seeded,
1262
+ useScrollProgress,
1263
+ useAnyScroll,
1264
+ Card3D,
1265
+ Card3DItem,
1266
+ HeroHighlight,
1267
+ Highlight
988
1268
  };
989
- //# sourceMappingURL=chunk-XDNSQ2Q7.js.map
1269
+ //# sourceMappingURL=chunk-LAE5NL7J.js.map