motion-ui-skill 2.0.0 → 2.1.1

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 (166) hide show
  1. package/README.md +71 -21
  2. package/SKILL.md +83 -9
  3. package/bin/index.mjs +2 -2
  4. package/bin/installer.mjs +6 -0
  5. package/catalog.json +1044 -139
  6. package/components/agents/thinking-states.tsx +156 -0
  7. package/components/buttons/aqua-button.tsx +145 -0
  8. package/components/buttons/ash-burst-button.tsx +528 -0
  9. package/components/buttons/brutal-button.tsx +68 -0
  10. package/components/buttons/chrome-button.tsx +444 -0
  11. package/components/buttons/click-powerup.tsx +203 -0
  12. package/components/buttons/command-button.tsx +226 -0
  13. package/components/buttons/confetti-button.tsx +132 -0
  14. package/components/buttons/cooldown-button.tsx +169 -0
  15. package/components/buttons/demonic-button.tsx +470 -0
  16. package/components/buttons/dither-button.tsx +192 -0
  17. package/components/buttons/doubt-button.tsx +240 -0
  18. package/components/buttons/evil-eye-button.tsx +563 -0
  19. package/components/buttons/frame-button.tsx +211 -0
  20. package/components/buttons/glitch-button.tsx +243 -0
  21. package/components/buttons/highlight-button.tsx +196 -0
  22. package/components/buttons/hold-button.tsx +245 -0
  23. package/components/buttons/minecraft-button.tsx +651 -0
  24. package/components/buttons/minimal-button.tsx +50 -0
  25. package/components/buttons/morph-status-button.tsx +264 -0
  26. package/components/buttons/movie-pass-button.tsx +205 -0
  27. package/components/buttons/realistic-switch.tsx +298 -0
  28. package/components/buttons/reveal-button.tsx +197 -0
  29. package/components/buttons/shiny-button.tsx +87 -0
  30. package/components/buttons/slide-to-detonate.tsx +444 -0
  31. package/components/buttons/sticky-button.tsx +184 -0
  32. package/components/buttons/thruster-button.tsx +920 -0
  33. package/components/buttons/troll-button.tsx +264 -0
  34. package/components/motion/banner-stacking.tsx +124 -0
  35. package/components/motion/delete-with-smoky-dissolve.tsx +145 -0
  36. package/components/motion/donut-chart.tsx +112 -0
  37. package/components/motion/drag-drop-with-physics.tsx +116 -0
  38. package/components/motion/dropdown-menu-morph.tsx +157 -0
  39. package/components/motion/get-pro-button.tsx +54 -0
  40. package/components/motion/image-open-tilt.tsx +79 -0
  41. package/components/motion/input-clear-with-dissolve.tsx +111 -0
  42. package/components/motion/learn-more-hover.tsx +71 -0
  43. package/components/motion/matrix-dot-loader.tsx +68 -0
  44. package/components/motion/organic-shimmer.tsx +49 -0
  45. package/components/motion/pro-gradient-text.tsx +46 -0
  46. package/components/motion/skeleton-loader-and-reveal.tsx +81 -0
  47. package/components/motion/spinner-to-check-morph.tsx +99 -0
  48. package/components/motion/spinning-counter.tsx +64 -0
  49. package/components/motion/text-morph.tsx +80 -0
  50. package/components/motion/texts-reveal.tsx +49 -0
  51. package/data/app-interface.csv +33 -0
  52. package/data/charts.csv +26 -0
  53. package/data/colors.csv +193 -0
  54. package/data/google-fonts.csv +1935 -0
  55. package/data/icons.csv +106 -0
  56. package/data/landing.csv +35 -0
  57. package/data/motion.csv +18 -0
  58. package/data/products.csv +193 -0
  59. package/data/react-performance.csv +45 -0
  60. package/data/stacks/angular.csv +51 -0
  61. package/data/stacks/astro.csv +54 -0
  62. package/data/stacks/avalonia.csv +57 -0
  63. package/data/stacks/flutter.csv +53 -0
  64. package/data/stacks/html-tailwind.csv +60 -0
  65. package/data/stacks/javafx.csv +76 -0
  66. package/data/stacks/jetpack-compose.csv +53 -0
  67. package/data/stacks/laravel.csv +51 -0
  68. package/data/stacks/nextjs.csv +62 -0
  69. package/data/stacks/nuxt-ui.csv +77 -0
  70. package/data/stacks/nuxtjs.csv +68 -0
  71. package/data/stacks/react-native.csv +52 -0
  72. package/data/stacks/react.csv +67 -0
  73. package/data/stacks/shadcn.csv +69 -0
  74. package/data/stacks/svelte.csv +56 -0
  75. package/data/stacks/swiftui.csv +51 -0
  76. package/data/stacks/threejs.csv +54 -0
  77. package/data/stacks/uno.csv +60 -0
  78. package/data/stacks/uwp.csv +56 -0
  79. package/data/stacks/vue.csv +50 -0
  80. package/data/stacks/winui.csv +60 -0
  81. package/data/stacks/wpf.csv +57 -0
  82. package/data/styles.csv +89 -0
  83. package/data/typography.csv +75 -0
  84. package/data/ui-reasoning.csv +193 -0
  85. package/data/ux-guidelines.csv +120 -0
  86. package/evals/catalog_eval.py +56 -0
  87. package/icons/annotations/loop-arrow.tsx +61 -0
  88. package/icons/brands/anthropic.tsx +26 -0
  89. package/icons/brands/apple.tsx +26 -0
  90. package/icons/brands/canva.tsx +26 -0
  91. package/icons/brands/claude-ai.tsx +26 -0
  92. package/icons/brands/discord.tsx +26 -0
  93. package/icons/brands/github.tsx +26 -0
  94. package/icons/brands/gmail.tsx +26 -0
  95. package/icons/brands/google.tsx +26 -0
  96. package/icons/brands/linkedin.tsx +29 -0
  97. package/icons/brands/microsoft.tsx +26 -0
  98. package/icons/brands/next-js.tsx +26 -0
  99. package/icons/brands/producthunt.tsx +26 -0
  100. package/icons/brands/react-js.tsx +29 -0
  101. package/icons/brands/shadcn-ui.tsx +26 -0
  102. package/icons/brands/tailwind-css.tsx +26 -0
  103. package/icons/brands/twitter.tsx +30 -0
  104. package/icons/brands/typescript.tsx +26 -0
  105. package/icons/brands/unsplash.tsx +27 -0
  106. package/icons/brands/vercel.tsx +26 -0
  107. package/icons/brands/whatsapp.tsx +26 -0
  108. package/package.json +9 -3
  109. package/prompts/install-motion-ui.md +17 -0
  110. package/references/agents/thinking-states.md +56 -0
  111. package/references/craft/aqua-button.md +53 -0
  112. package/references/craft/ash-burst-button.md +55 -0
  113. package/references/craft/brutal-button.md +52 -0
  114. package/references/craft/chrome-button.md +53 -0
  115. package/references/craft/click-powerup.md +53 -0
  116. package/references/craft/command-button.md +53 -0
  117. package/references/craft/confetti-button.md +54 -0
  118. package/references/craft/cooldown-button.md +54 -0
  119. package/references/craft/demonic-button.md +53 -0
  120. package/references/craft/dither-button.md +52 -0
  121. package/references/craft/doubt-button.md +53 -0
  122. package/references/craft/evil-eye-button.md +52 -0
  123. package/references/craft/frame-button.md +54 -0
  124. package/references/craft/glitch-button.md +52 -0
  125. package/references/craft/highlight-button.md +53 -0
  126. package/references/craft/hold-button.md +53 -0
  127. package/references/craft/minecraft-button.md +53 -0
  128. package/references/craft/minimal-button.md +52 -0
  129. package/references/craft/morph-status-button.md +53 -0
  130. package/references/craft/movie-pass-button.md +53 -0
  131. package/references/craft/realistic-switch.md +54 -0
  132. package/references/craft/reveal-button.md +53 -0
  133. package/references/craft/shiny-button.md +52 -0
  134. package/references/craft/slide-to-detonate.md +53 -0
  135. package/references/craft/sticky-button.md +54 -0
  136. package/references/craft/thruster-button.md +53 -0
  137. package/references/craft/troll-button.md +54 -0
  138. package/references/guides/design-intelligence.md +125 -0
  139. package/references/guides/interaction-transitions.md +56 -38
  140. package/references/guides/motion-polish-rules.md +75 -0
  141. package/references/guides/stack-best-practices.md +38 -0
  142. package/references/motion/banner-stacking.md +67 -0
  143. package/references/motion/delete-with-smoky-dissolve.md +60 -0
  144. package/references/motion/donut-chart.md +79 -0
  145. package/references/motion/drag-drop-with-physics.md +61 -0
  146. package/references/motion/dropdown-menu-morph.md +55 -0
  147. package/references/motion/get-pro-button.md +56 -0
  148. package/references/motion/image-open-tilt.md +60 -0
  149. package/references/motion/input-clear-with-dissolve.md +58 -0
  150. package/references/motion/learn-more-hover.md +56 -0
  151. package/references/motion/matrix-dot-loader.md +58 -0
  152. package/references/motion/organic-shimmer.md +63 -0
  153. package/references/motion/pro-gradient-text.md +57 -0
  154. package/references/motion/skeleton-loader-and-reveal.md +67 -0
  155. package/references/motion/spinner-to-check-morph.md +67 -0
  156. package/references/motion/spinning-counter.md +74 -0
  157. package/references/motion/text-morph.md +64 -0
  158. package/references/motion/texts-reveal.md +56 -0
  159. package/scripts/build_docs.py +39 -4
  160. package/scripts/core.py +993 -0
  161. package/scripts/design_system.py +1668 -0
  162. package/scripts/reasoning_contract.py +123 -0
  163. package/scripts/search.py +177 -0
  164. package/scripts/test_release.py +12 -0
  165. package/scripts/verify_skill.py +4 -4
  166. package/test/test_installer.mjs +133 -0
@@ -0,0 +1,116 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { useState, useRef } from "react";
5
+ import { motion, useMotionValue, useTransform } from "motion/react";
6
+ import { cn } from "@/lib/utils";
7
+ import { SPRING_BOUNCE } from "@/lib/ease";
8
+
9
+ export interface DragDropWithPhysicsProps {
10
+ title?: string;
11
+ category?: string;
12
+ onDropInZone?: (zoneId: string) => void;
13
+ className?: string;
14
+ }
15
+
16
+ export function DragDropWithPhysics({
17
+ title = "Design System Refactor",
18
+ category = "Engineering",
19
+ onDropInZone,
20
+ className,
21
+ }: DragDropWithPhysicsProps) {
22
+ const [currentZone, setCurrentZone] = useState<"todo" | "done">("todo");
23
+ const [isDragging, setIsDragging] = useState(false);
24
+
25
+ const x = useMotionValue(0);
26
+ const y = useMotionValue(0);
27
+ const rotate = useTransform(x, [-150, 150], [-12, 12]);
28
+
29
+ const handleDragEnd = (
30
+ _event: MouseEvent | TouchEvent | PointerEvent,
31
+ info: { offset: { x: number; y: number } }
32
+ ) => {
33
+ setIsDragging(false);
34
+ if (info.offset.x > 100) {
35
+ setCurrentZone("done");
36
+ onDropInZone?.("done");
37
+ } else if (info.offset.x < -100) {
38
+ setCurrentZone("todo");
39
+ onDropInZone?.("todo");
40
+ }
41
+ };
42
+
43
+ return (
44
+ <div
45
+ className={cn(
46
+ "relative flex flex-col items-center gap-6 p-6 w-full max-w-lg mx-auto select-none",
47
+ className
48
+ )}
49
+ >
50
+ <div className="grid grid-cols-2 gap-4 w-full">
51
+ <div
52
+ className={cn(
53
+ "h-32 rounded-2xl border-2 border-dashed p-4 flex flex-col justify-between transition-colors",
54
+ currentZone === "todo"
55
+ ? "border-sky-500/50 bg-sky-50/50 dark:bg-sky-950/20"
56
+ : "border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/20"
57
+ )}
58
+ >
59
+ <span className="text-xs font-semibold text-neutral-500 uppercase tracking-wider">
60
+ In Progress
61
+ </span>
62
+ <span className="text-xs text-neutral-400">Drag here to queue</span>
63
+ </div>
64
+
65
+ <div
66
+ className={cn(
67
+ "h-32 rounded-2xl border-2 border-dashed p-4 flex flex-col justify-between transition-colors",
68
+ currentZone === "done"
69
+ ? "border-emerald-500/50 bg-emerald-50/50 dark:bg-emerald-950/20"
70
+ : "border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/20"
71
+ )}
72
+ >
73
+ <span className="text-xs font-semibold text-neutral-500 uppercase tracking-wider">
74
+ Completed
75
+ </span>
76
+ <span className="text-xs text-neutral-400">Drag here to finish</span>
77
+ </div>
78
+ </div>
79
+
80
+ <motion.div
81
+ drag
82
+ dragConstraints={{ left: -140, right: 140, top: -50, bottom: 50 }}
83
+ dragElastic={0.2}
84
+ style={{ x, y, rotate }}
85
+ onDragStart={() => setIsDragging(true)}
86
+ onDragEnd={handleDragEnd}
87
+ animate={{
88
+ scale: isDragging ? 1.05 : 1,
89
+ boxShadow: isDragging
90
+ ? "0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"
91
+ : "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
92
+ }}
93
+ transition={SPRING_BOUNCE}
94
+ className={cn(
95
+ "w-64 p-4 rounded-xl border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 cursor-grab active:cursor-grabbing",
96
+ "hover:border-neutral-300 dark:hover:border-neutral-700 transition-colors"
97
+ )}
98
+ >
99
+ <div className="flex items-center justify-between mb-2">
100
+ <span className="px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider rounded-md bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-300">
101
+ {category}
102
+ </span>
103
+ <span className="text-[10px] text-neutral-400">
104
+ {currentZone === "done" ? "✓ Done" : "⚡ Active"}
105
+ </span>
106
+ </div>
107
+ <h4 className="text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1">
108
+ {title}
109
+ </h4>
110
+ <p className="text-xs text-neutral-500 dark:text-neutral-400">
111
+ Hold and drag left or right to switch destination zone.
112
+ </p>
113
+ </motion.div>
114
+ </div>
115
+ );
116
+ }
@@ -0,0 +1,157 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { useState, useRef } from "react";
5
+ import { motion, AnimatePresence } from "motion/react";
6
+ import { cn } from "@/lib/utils";
7
+ import { SPRING_LAYOUT, SPRING_PANEL } from "@/lib/ease";
8
+
9
+ export interface NavTabItem {
10
+ id: string;
11
+ label: string;
12
+ content: React.ReactNode;
13
+ }
14
+
15
+ export interface DropdownMenuMorphProps {
16
+ tabs?: NavTabItem[];
17
+ className?: string;
18
+ }
19
+
20
+ const DEFAULT_TABS: NavTabItem[] = [
21
+ {
22
+ id: "products",
23
+ label: "Products",
24
+ content: (
25
+ <div className="w-80 p-4 space-y-3">
26
+ <h4 className="text-xs font-semibold uppercase tracking-wider text-neutral-400">
27
+ Core Platform
28
+ </h4>
29
+ <div className="space-y-2">
30
+ <a
31
+ href="#engine"
32
+ className="block p-2 rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors"
33
+ >
34
+ <div className="text-sm font-medium text-neutral-900 dark:text-neutral-100">
35
+ Motion Engine
36
+ </div>
37
+ <div className="text-xs text-neutral-500">
38
+ High-performance 120 FPS spring physics
39
+ </div>
40
+ </a>
41
+ <a
42
+ href="#ai"
43
+ className="block p-2 rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors"
44
+ >
45
+ <div className="text-sm font-medium text-neutral-900 dark:text-neutral-100">
46
+ Agent Surfaces
47
+ </div>
48
+ <div className="text-xs text-neutral-500">
49
+ Chat, code diffs, and streaming components
50
+ </div>
51
+ </a>
52
+ </div>
53
+ </div>
54
+ ),
55
+ },
56
+ {
57
+ id: "developers",
58
+ label: "Developers",
59
+ content: (
60
+ <div className="w-96 p-4 space-y-3">
61
+ <h4 className="text-xs font-semibold uppercase tracking-wider text-neutral-400">
62
+ Resources
63
+ </h4>
64
+ <div className="grid grid-cols-2 gap-2">
65
+ <div className="p-2 rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors">
66
+ <div className="text-sm font-medium text-neutral-900 dark:text-neutral-100">
67
+ Documentation
68
+ </div>
69
+ <div className="text-xs text-neutral-500">API guides & props</div>
70
+ </div>
71
+ <div className="p-2 rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors">
72
+ <div className="text-sm font-medium text-neutral-900 dark:text-neutral-100">
73
+ CLI Installer
74
+ </div>
75
+ <div className="text-xs text-neutral-500">Zero-config sync</div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ ),
80
+ },
81
+ {
82
+ id: "company",
83
+ label: "Company",
84
+ content: (
85
+ <div className="w-64 p-4 space-y-2">
86
+ <h4 className="text-xs font-semibold uppercase tracking-wider text-neutral-400 mb-2">
87
+ About
88
+ </h4>
89
+ <div className="text-xs text-neutral-600 dark:text-neutral-300 leading-relaxed">
90
+ Crafting the highest fidelity motion primitives and AI agent interfaces.
91
+ </div>
92
+ </div>
93
+ ),
94
+ },
95
+ ];
96
+
97
+ export function DropdownMenuMorph({
98
+ tabs = DEFAULT_TABS,
99
+ className,
100
+ }: DropdownMenuMorphProps) {
101
+ const [activeTab, setActiveTab] = useState<string | null>(null);
102
+
103
+ const activeContent = tabs.find((t) => t.id === activeTab)?.content;
104
+
105
+ return (
106
+ <div
107
+ className={cn("relative flex flex-col items-center", className)}
108
+ onMouseLeave={() => setActiveTab(null)}
109
+ >
110
+ <nav className="flex items-center gap-1 p-1 rounded-full border border-neutral-200 dark:border-neutral-800 bg-white/80 dark:bg-neutral-900/80 backdrop-blur-md shadow-sm">
111
+ {tabs.map((tab) => {
112
+ const isActive = activeTab === tab.id;
113
+ return (
114
+ <button
115
+ key={tab.id}
116
+ type="button"
117
+ onMouseEnter={() => setActiveTab(tab.id)}
118
+ onFocus={() => setActiveTab(tab.id)}
119
+ className={cn(
120
+ "relative px-4 py-2 text-sm font-medium rounded-full transition-colors",
121
+ isActive
122
+ ? "text-neutral-900 dark:text-neutral-100"
123
+ : "text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"
124
+ )}
125
+ >
126
+ {tab.label}
127
+ {isActive && (
128
+ <motion.div
129
+ layoutId="active-pill"
130
+ className="absolute inset-0 rounded-full bg-neutral-100 dark:bg-neutral-800 -z-10"
131
+ transition={SPRING_LAYOUT}
132
+ />
133
+ )}
134
+ </button>
135
+ );
136
+ })}
137
+ </nav>
138
+
139
+ <AnimatePresence>
140
+ {activeTab && (
141
+ <motion.div
142
+ layout
143
+ initial={{ opacity: 0, y: 8, scale: 0.96 }}
144
+ animate={{ opacity: 1, y: 12, scale: 1 }}
145
+ exit={{ opacity: 0, y: 8, scale: 0.96 }}
146
+ transition={SPRING_PANEL}
147
+ className="absolute top-full z-50 rounded-2xl border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 shadow-2xl overflow-hidden backdrop-blur-xl"
148
+ >
149
+ <motion.div layout="position" transition={SPRING_LAYOUT}>
150
+ {activeContent}
151
+ </motion.div>
152
+ </motion.div>
153
+ )}
154
+ </AnimatePresence>
155
+ </div>
156
+ );
157
+ }
@@ -0,0 +1,54 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { motion } from "motion/react";
5
+ import { cn } from "@/lib/utils";
6
+ import { SPRING_PRESS } from "@/lib/ease";
7
+
8
+ export interface GetProButtonProps
9
+ extends React.ButtonHTMLAttributes<HTMLButtonElement> {
10
+ children?: React.ReactNode;
11
+ glow?: boolean;
12
+ }
13
+
14
+ export function GetProButton({
15
+ children = "Upgrade to Pro",
16
+ glow = true,
17
+ className,
18
+ ...props
19
+ }: GetProButtonProps) {
20
+ return (
21
+ <div className="relative inline-flex group">
22
+ {glow && (
23
+ <div
24
+ className="absolute -inset-0.5 rounded-full bg-gradient-to-r from-amber-500 via-rose-500 to-indigo-500 opacity-60 blur-md group-hover:opacity-100 transition duration-500 group-hover:duration-200"
25
+ aria-hidden="true"
26
+ />
27
+ )}
28
+ <motion.button
29
+ type="button"
30
+ whileTap={{ scale: 0.96 }}
31
+ transition={SPRING_PRESS}
32
+ className={cn(
33
+ "relative inline-flex items-center justify-center gap-2 px-6 py-3 rounded-full font-semibold text-sm",
34
+ "bg-neutral-950 text-white dark:bg-white dark:text-neutral-950",
35
+ "border border-white/20 dark:border-neutral-800 shadow-xl overflow-hidden",
36
+ className
37
+ )}
38
+ {...props}
39
+ >
40
+ <span
41
+ className="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000 ease-out"
42
+ aria-hidden="true"
43
+ />
44
+ <svg
45
+ className="size-4 text-amber-400 dark:text-amber-500 fill-current animate-pulse"
46
+ viewBox="0 0 24 24"
47
+ >
48
+ <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
49
+ </svg>
50
+ <span>{children}</span>
51
+ </motion.button>
52
+ </div>
53
+ );
54
+ }
@@ -0,0 +1,79 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { useState } from "react";
5
+ import { motion, AnimatePresence } from "motion/react";
6
+ import { cn } from "@/lib/utils";
7
+ import { SPRING_PANEL, SPRING_PRESS } from "@/lib/ease";
8
+
9
+ export interface ImageOpenTiltProps {
10
+ src?: string;
11
+ alt?: string;
12
+ title?: string;
13
+ className?: string;
14
+ }
15
+
16
+ export function ImageOpenTilt({
17
+ src = "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=800&q=80",
18
+ alt = "Abstract architectural forms",
19
+ title = "Parametric Structure",
20
+ className,
21
+ }: ImageOpenTiltProps) {
22
+ const [isOpen, setIsOpen] = useState(false);
23
+
24
+ return (
25
+ <div className={cn("inline-block", className)}>
26
+ <motion.div
27
+ whileHover={{ scale: 1.02 }}
28
+ whileTap={{ scale: 0.98 }}
29
+ transition={SPRING_PRESS}
30
+ onClick={() => setIsOpen(true)}
31
+ className="group relative cursor-pointer overflow-hidden rounded-2xl border border-neutral-200 dark:border-neutral-800 bg-neutral-100 dark:bg-neutral-900 shadow-md"
32
+ >
33
+ <img
34
+ src={src}
35
+ alt={alt}
36
+ className="h-48 w-72 object-cover transition-transform duration-500 group-hover:scale-105"
37
+ />
38
+ <div className="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity p-4 flex flex-col justify-end">
39
+ <span className="text-xs font-medium text-white/80">Click to expand</span>
40
+ <span className="text-sm font-semibold text-white">{title}</span>
41
+ </div>
42
+ </motion.div>
43
+
44
+ <AnimatePresence>
45
+ {isOpen && (
46
+ <motion.div
47
+ initial={{ opacity: 0 }}
48
+ animate={{ opacity: 1 }}
49
+ exit={{ opacity: 0 }}
50
+ onClick={() => setIsOpen(false)}
51
+ className="fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-md p-6"
52
+ >
53
+ <motion.div
54
+ initial={{ scale: 0.85, rotateX: 25, y: 40, opacity: 0 }}
55
+ animate={{ scale: 1, rotateX: 0, y: 0, opacity: 1 }}
56
+ exit={{ scale: 0.9, rotateX: -15, y: 20, opacity: 0 }}
57
+ transition={SPRING_PANEL}
58
+ style={{ transformPerspective: 1000 }}
59
+ onClick={(e) => e.stopPropagation()}
60
+ className="relative max-w-2xl w-full rounded-2xl overflow-hidden border border-white/20 bg-neutral-950 shadow-2xl"
61
+ >
62
+ <img src={src} alt={alt} className="w-full h-auto max-h-[75vh] object-contain" />
63
+ <div className="p-4 flex items-center justify-between bg-neutral-900/90 border-t border-white/10">
64
+ <span className="text-sm font-semibold text-white">{title}</span>
65
+ <button
66
+ type="button"
67
+ onClick={() => setIsOpen(false)}
68
+ className="px-3 py-1.5 text-xs font-semibold rounded-lg bg-white/10 hover:bg-white/20 text-white transition-colors"
69
+ >
70
+ Close
71
+ </button>
72
+ </div>
73
+ </motion.div>
74
+ </motion.div>
75
+ )}
76
+ </AnimatePresence>
77
+ </div>
78
+ );
79
+ }
@@ -0,0 +1,111 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { useState } from "react";
5
+ import { motion, AnimatePresence } from "motion/react";
6
+ import { cn } from "@/lib/utils";
7
+ import { SPRING_PRESS, SPRING_SWAP } from "@/lib/ease";
8
+
9
+ export interface InputClearWithDissolveProps
10
+ extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
11
+ value?: string;
12
+ defaultValue?: string;
13
+ onValueChange?: (val: string) => void;
14
+ className?: string;
15
+ }
16
+
17
+ export function InputClearWithDissolve({
18
+ value: controlledValue,
19
+ defaultValue = "search query",
20
+ onValueChange,
21
+ className,
22
+ placeholder = "Type something...",
23
+ ...props
24
+ }: InputClearWithDissolveProps) {
25
+ const [internalValue, setInternalValue] = useState(defaultValue);
26
+ const [dissolvingText, setDissolvingText] = useState<string | null>(null);
27
+
28
+ const value = controlledValue !== undefined ? controlledValue : internalValue;
29
+
30
+ const handleClear = () => {
31
+ if (!value) return;
32
+ setDissolvingText(value);
33
+ setInternalValue("");
34
+ onValueChange?.("");
35
+ setTimeout(() => {
36
+ setDissolvingText(null);
37
+ }, 450);
38
+ };
39
+
40
+ return (
41
+ <div className={cn("relative inline-flex items-center w-full max-w-sm", className)}>
42
+ <input
43
+ type="text"
44
+ value={value}
45
+ onChange={(e) => {
46
+ setInternalValue(e.target.value);
47
+ onValueChange?.(e.target.value);
48
+ }}
49
+ placeholder={placeholder}
50
+ className={cn(
51
+ "w-full px-4 py-2.5 pr-10 text-sm rounded-xl border border-neutral-300 dark:border-neutral-700",
52
+ "bg-white dark:bg-neutral-900 text-neutral-900 dark:text-neutral-100",
53
+ "focus:outline-none focus:ring-2 focus:ring-neutral-400 dark:focus:ring-neutral-600 transition-shadow",
54
+ dissolvingText ? "text-transparent placeholder-transparent" : ""
55
+ )}
56
+ {...props}
57
+ />
58
+
59
+ {dissolvingText && (
60
+ <div className="absolute left-4 top-2.5 pointer-events-none flex overflow-hidden">
61
+ {dissolvingText.split("").map((char, index) => (
62
+ <motion.span
63
+ key={index}
64
+ initial={{ opacity: 1, y: 0, filter: "blur(0px)" }}
65
+ animate={{
66
+ opacity: 0,
67
+ y: -12 - Math.random() * 8,
68
+ x: (Math.random() - 0.5) * 16,
69
+ filter: "blur(4px)",
70
+ }}
71
+ transition={{
72
+ duration: 0.35,
73
+ delay: index * 0.015,
74
+ ease: [0.16, 1, 0.3, 1],
75
+ }}
76
+ className="text-sm font-normal text-neutral-900 dark:text-neutral-100 whitespace-pre"
77
+ >
78
+ {char}
79
+ </motion.span>
80
+ ))}
81
+ </div>
82
+ )}
83
+
84
+ <AnimatePresence>
85
+ {value.length > 0 && (
86
+ <motion.button
87
+ type="button"
88
+ initial={{ opacity: 0, scale: 0.8 }}
89
+ animate={{ opacity: 1, scale: 1 }}
90
+ exit={{ opacity: 0, scale: 0.8 }}
91
+ transition={SPRING_SWAP}
92
+ whileTap={{ scale: 0.9 }}
93
+ onClick={handleClear}
94
+ className="absolute right-3 p-1 rounded-full text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors"
95
+ aria-label="Clear input"
96
+ >
97
+ <svg
98
+ className="size-3.5"
99
+ fill="none"
100
+ viewBox="0 0 24 24"
101
+ stroke="currentColor"
102
+ strokeWidth={2.5}
103
+ >
104
+ <path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
105
+ </svg>
106
+ </motion.button>
107
+ )}
108
+ </AnimatePresence>
109
+ </div>
110
+ );
111
+ }
@@ -0,0 +1,71 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { useState } from "react";
5
+ import { motion } from "motion/react";
6
+ import { cn } from "@/lib/utils";
7
+ import { SPRING_PRESS, SPRING_BOUNCE } from "@/lib/ease";
8
+
9
+ export interface LearnMoreHoverProps
10
+ extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
11
+ label?: string;
12
+ href?: string;
13
+ }
14
+
15
+ export function LearnMoreHover({
16
+ label = "Explore Documentation",
17
+ href = "#",
18
+ className,
19
+ ...props
20
+ }: LearnMoreHoverProps) {
21
+ const [isHovered, setIsHovered] = useState(false);
22
+
23
+ return (
24
+ <motion.a
25
+ href={href}
26
+ onMouseEnter={() => setIsHovered(true)}
27
+ onMouseLeave={() => setIsHovered(false)}
28
+ whileTap={{ scale: 0.98 }}
29
+ transition={SPRING_PRESS}
30
+ className={cn(
31
+ "group inline-flex items-center gap-2 py-1 font-semibold text-sm",
32
+ "text-neutral-900 dark:text-neutral-100 hover:text-black dark:hover:text-white transition-colors",
33
+ className
34
+ )}
35
+ {...props}
36
+ >
37
+ <span className="relative">
38
+ {label}
39
+ <motion.span
40
+ className="absolute left-0 bottom-0 w-full h-[1.5px] bg-neutral-900 dark:bg-neutral-100 origin-left"
41
+ initial={{ scaleX: 0 }}
42
+ animate={{ scaleX: isHovered ? 1 : 0 }}
43
+ transition={{ duration: 0.3, ease: [0.16, 1, 0.3, 1] }}
44
+ />
45
+ </span>
46
+
47
+ <div className="relative size-4 overflow-hidden flex items-center justify-center">
48
+ <motion.svg
49
+ className="size-4 shrink-0"
50
+ fill="none"
51
+ viewBox="0 0 24 24"
52
+ stroke="currentColor"
53
+ strokeWidth={2}
54
+ animate={{
55
+ x: isHovered ? [0, 16, -16, 0] : 0,
56
+ }}
57
+ transition={{
58
+ duration: 0.45,
59
+ ease: [0.16, 1, 0.3, 1],
60
+ }}
61
+ >
62
+ <path
63
+ strokeLinecap="round"
64
+ strokeLinejoin="round"
65
+ d="M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"
66
+ />
67
+ </motion.svg>
68
+ </div>
69
+ </motion.a>
70
+ );
71
+ }
@@ -0,0 +1,68 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { motion } from "motion/react";
5
+ import { cn } from "@/lib/utils";
6
+
7
+ export interface MatrixDotLoaderProps {
8
+ rows?: number;
9
+ cols?: number;
10
+ size?: number;
11
+ gap?: number;
12
+ color?: string;
13
+ className?: string;
14
+ }
15
+
16
+ export function MatrixDotLoader({
17
+ rows = 4,
18
+ cols = 4,
19
+ size = 6,
20
+ gap = 6,
21
+ className,
22
+ }: MatrixDotLoaderProps) {
23
+ const dots = [];
24
+
25
+ for (let r = 0; r < rows; r++) {
26
+ for (let c = 0; c < cols; c++) {
27
+ const delay = (r + c) * 0.08;
28
+ dots.push({ r, c, delay });
29
+ }
30
+ }
31
+
32
+ return (
33
+ <div
34
+ className={cn("inline-flex flex-col items-center justify-center p-4", className)}
35
+ role="status"
36
+ aria-label="Loading"
37
+ >
38
+ <div
39
+ className="grid"
40
+ style={{
41
+ gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
42
+ gap: `${gap}px`,
43
+ }}
44
+ >
45
+ {dots.map((dot, idx) => (
46
+ <motion.div
47
+ key={idx}
48
+ animate={{
49
+ scale: [0.6, 1.25, 0.6],
50
+ opacity: [0.25, 1, 0.25],
51
+ }}
52
+ transition={{
53
+ duration: 1.2,
54
+ repeat: Infinity,
55
+ delay: dot.delay,
56
+ ease: "easeInOut",
57
+ }}
58
+ style={{
59
+ width: `${size}px`,
60
+ height: `${size}px`,
61
+ }}
62
+ className="rounded-full bg-neutral-900 dark:bg-neutral-100"
63
+ />
64
+ ))}
65
+ </div>
66
+ </div>
67
+ );
68
+ }