🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Update package dependencies and enhance global styles for improved UI consistency
Bill Yangbba3a6b1957f
diff --git a/docs/components.json b/docs/components.jsonnew file mode 100644index 000000000..29e52618e--- /dev/null+++ b/docs/components.json@@ -0,0 +1,24 @@+{+ "$schema": "https://ui.shadcn.com/schema.json",+ "style": "new-york",+ "rsc": true,+ "tsx": true,+ "tailwind": {+ "config": "tailwind.config.ts",+ "css": "src/app/global.css",+ "baseColor": "neutral",+ "cssVariables": true,+ "prefix": ""+ },+ "iconLibrary": "lucide",+ "aliases": {+ "components": "@/components",+ "utils": "@/lib/utils",+ "ui": "@/components/ui",+ "lib": "@/lib",+ "hooks": "@/hooks"+ },+ "registries": {+ "@lucide-animated": "https://lucide-animated.com/r/{name}.json"+ }+}diff --git a/docs/package-lock.json b/docs/package-lock.jsonindex 2ba0b6844..252b544d8 100644--- a/docs/package-lock.json+++ b/docs/package-lock.json@@ -26,13 +26,16 @@"luxon": "^3.7.2","mapbox-gl": "^3.16.0","mermaid": "^11.12.0",+ "motion": "^12.29.0","next": "16.0.7","next-themes": "^0.4.6","react": "^19.2.0","react-dom": "^19.2.0","react-easy-crop": "^5.5.5","react-tweet": "^3.2.2",- "tailwind-merge": "^3.3.1",+ "tailwind-merge": "^3.4.0",+ "tailwindcss-animate": "^1.0.7",+ "tw-animate-css": "^1.4.0","zod": "^4.1.12"},"devDependencies": {@@ -6594,6 +6597,33 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/framer-motion": {+ "version": "12.29.0",+ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.29.0.tgz",+ "integrity": "sha512-1gEFGXHYV2BD42ZPTFmSU9buehppU+bCuOnHU0AD18DKh9j4DuTx47MvqY5ax+NNWRtK32qIcJf1UxKo1WwjWg==",+ "license": "MIT",+ "dependencies": {+ "motion-dom": "^12.29.0",+ "motion-utils": "^12.27.2",+ "tslib": "^2.4.0"+ },+ "peerDependencies": {+ "@emotion/is-prop-valid": "*",+ "react": "^18.0.0 || ^19.0.0",+ "react-dom": "^18.0.0 || ^19.0.0"+ },+ "peerDependenciesMeta": {+ "@emotion/is-prop-valid": {+ "optional": true+ },+ "react": {+ "optional": true+ },+ "react-dom": {+ "optional": true+ }+ }+ },"node_modules/fumadocs-core": {"version": "16.0.3","resolved": "https://registry.npmjs.org/fumadocs-core/-/fumadocs-core-16.0.3.tgz",@@ -9640,6 +9670,47 @@"pathe": "^2.0.1"}},+ "node_modules/motion": {+ "version": "12.29.0",+ "resolved": "https://registry.npmjs.org/motion/-/motion-12.29.0.tgz",+ "integrity": "sha512-rjB5CP2N9S2ESAyEFnAFMgTec6X8yvfxLNcz8n12gPq3M48R7ZbBeVYkDOTj8SPMwfvGIFI801SiPSr1+HCr9g==",+ "license": "MIT",+ "dependencies": {+ "framer-motion": "^12.29.0",+ "tslib": "^2.4.0"+ },+ "peerDependencies": {+ "@emotion/is-prop-valid": "*",+ "react": "^18.0.0 || ^19.0.0",+ "react-dom": "^18.0.0 || ^19.0.0"+ },+ "peerDependenciesMeta": {+ "@emotion/is-prop-valid": {+ "optional": true+ },+ "react": {+ "optional": true+ },+ "react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/motion-dom": {+ "version": "12.29.0",+ "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.29.0.tgz",+ "integrity": "sha512-3eiz9bb32yvY8Q6XNM4AwkSOBPgU//EIKTZwsSWgA9uzbPBhZJeScCVcBuwwYVqhfamewpv7ZNmVKTGp5qnzkA==",+ "license": "MIT",+ "dependencies": {+ "motion-utils": "^12.27.2"+ }+ },+ "node_modules/motion-utils": {+ "version": "12.27.2",+ "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.27.2.tgz",+ "integrity": "sha512-B55gcoL85Mcdt2IEStY5EEAsrMSVE2sI14xQ/uAdPL+mfQxhKKFaEag9JmfxedJOR4vZpBGoPeC/Gm13I/4g5Q==",+ "license": "MIT"+ },"node_modules/ms": {"version": "2.1.3","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",@@ -11465,9 +11536,17 @@"version": "4.1.17","resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz","integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==",- "devOptional": true,"license": "MIT"},+ "node_modules/tailwindcss-animate": {+ "version": "1.0.7",+ "resolved": "https://registry.npmjs.org/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz",+ "integrity": "sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==",+ "license": "MIT",+ "peerDependencies": {+ "tailwindcss": ">=3.0.0 || insiders"+ }+ },"node_modules/tapable": {"version": "2.3.0","resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz",@@ -11600,6 +11679,15 @@"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==","license": "0BSD"},+ "node_modules/tw-animate-css": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz",+ "integrity": "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/Wombosvideo"+ }+ },"node_modules/type-check": {"version": "0.4.0","resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",diff --git a/docs/package.json b/docs/package.jsonindex e10e6b49b..b5bce91e6 100644--- a/docs/package.json+++ b/docs/package.json@@ -26,13 +26,16 @@"luxon": "^3.7.2","mapbox-gl": "^3.16.0","mermaid": "^11.12.0",+ "motion": "^12.29.0","next": "16.0.7","next-themes": "^0.4.6","react": "^19.2.0","react-dom": "^19.2.0","react-easy-crop": "^5.5.5","react-tweet": "^3.2.2",- "tailwind-merge": "^3.3.1",+ "tailwind-merge": "^3.4.0",+ "tailwindcss-animate": "^1.0.7",+ "tw-animate-css": "^1.4.0","zod": "^4.1.12"},"devDependencies": {diff --git a/docs/src/app/(home)/page.tsx b/docs/src/app/(home)/page.tsxindex 1a4c659f6..9ac63ede7 100644--- a/docs/src/app/(home)/page.tsx+++ b/docs/src/app/(home)/page.tsx@@ -6,26 +6,24 @@ import { Marquee } from "@/components/magicui/marquee";import { SectionBadge } from "@/components/SectionBadge";import { TrackedButton } from "@/components/TrackedButton";import { TweetCard } from "@/components/Tweet";+import { ActivityIcon } from "@/components/ui/activity";+import { ArrowDownIcon } from "@/components/ui/arrow-down";+import { BanIcon } from "@/components/ui/ban";+import { BellIcon } from "@/components/ui/bell";+import { BotIcon } from "@/components/ui/bot";+import { CircleCheckIcon } from "@/components/ui/circle-check";+import { DownloadIcon } from "@/components/ui/download";+import { EarthIcon } from "@/components/ui/earth";+import { GaugeIcon } from "@/components/ui/gauge";+import { LayersIcon } from "@/components/ui/layers";+import { LinkIcon } from "@/components/ui/link";+import { PlayIcon } from "@/components/ui/play";+import { RouteIcon } from "@/components/ui/route";+import { ShieldCheckIcon } from "@/components/ui/shield-check";+import { TerminalIcon } from "@/components/ui/terminal";+import { UsersIcon } from "@/components/ui/users";+import { ZapIcon } from "@/components/ui/zap";import { cn } from "@/lib/utils";-import {- Activity,- Bot,- Building,- CheckCircle,- Code,- Cookie,- Download,- Funnel,- Gauge,- Globe2,- Layers,- Mail,- Plug,- Route,- ShieldCheck,- Video,- Zap,-} from "lucide-react";import { Tilt_Warp } from "next/font/google";import Image from "next/image";import Link from "next/link";@@ -103,82 +101,82 @@ export const metadata = {const features = [{- icon: Zap,+ icon: ZapIcon,title: "Setup in minutes",description: "Add one line of code and start seeing real-time data instantly.",},{- icon: Activity,+ icon: ActivityIcon,title: "Realtime data",description: "See what's happening on your site right now.",},{- icon: Video,+ icon: PlayIcon,title: "Session replay",description: "Watch real user sessions to spot usability issues.",},{- icon: Funnel,+ icon: ArrowDownIcon,title: "Funnels",description: "Visualize conversion paths and find where visitors drop off.",},{- icon: Route,+ icon: RouteIcon,title: "User journeys",description: "Map how users navigate from landing to conversion.",},{- icon: Gauge,+ icon: GaugeIcon,title: "Web vitals",description: "Monitor Core Web Vitals for fast user experiences.",},{- icon: Layers,+ icon: LayersIcon,title: "Custom events",description: "Track sign-ups, purchases, and any user interaction.",},{- icon: Bot,+ icon: BotIcon,title: "Bot blocking",description: "Automatically filter out bots to keep data clean.",},{- icon: Cookie,+ icon: BanIcon,title: "No cookies",description: "Zero cookies, zero banners. Cleaner visitor experiences.",},{- icon: ShieldCheck,+ icon: ShieldCheckIcon,title: "GDPR & CCPA",description: "Privacy-first design means you're compliant out of the box.",},{- icon: Globe2,+ icon: EarthIcon,title: "Globe views",description: "Watch traffic flow with stunning 3D globe visualizations.",},{- icon: Code,+ icon: TerminalIcon,title: "Open source",description: "100% open source. Self-host or use our cloud.",},{- icon: Plug,+ icon: LinkIcon,title: "API",description: "Full API access to build custom integrations.",},{- icon: Download,+ icon: DownloadIcon,title: "Data export",description: "Export your raw data anytime. No lock-in.",},{- icon: Mail,+ icon: BellIcon,title: "Email reports",description: "Automated reports delivered to your inbox.",},{- icon: Building,+ icon: UsersIcon,title: "Organizations",description: "Manage sites and team access in one place.",},@@ -241,7 +239,7 @@ export default function HomePage() {</TrackedButton></div><p className="text-neutral-500 dark:text-neutral-400 text-xs md:text-sm flex items-center justify-center gap-2 mt-6">- <CheckCircle className="w-3 h-3 md:w-4 md:h-4" />+ <CircleCheckIcon size={16} className="text-neutral-500 dark:text-neutral-400" />First {DEFAULT_EVENT_LIMIT.toLocaleString()} pageviews/m are free. No credit card required.</p></div>@@ -391,7 +389,7 @@ export default function HomePage() {className="bg-neutral-100/50 dark:bg-neutral-900 border border-neutral-300/50 dark:border-neutral-800/50 rounded-lg p-5 transition-colors"><h3 className="font-semibold mb-2 flex items-center gap-2">- <Icon className="w-5 h-5 text-neutral-600 dark:text-neutral-400" />+ <Icon size={20} className="text-neutral-600 dark:text-neutral-400" />{feature.title}</h3><p className="text-sm text-neutral-600 dark:text-neutral-400 leading-relaxed">diff --git a/docs/src/app/global.css b/docs/src/app/global.cssindex c816227dd..48aa48504 100644--- a/docs/src/app/global.css+++ b/docs/src/app/global.css@@ -1,13 +1,18 @@@import "tailwindcss";++@plugin "tailwindcss-animate";@import "fumadocs-ui/css/neutral.css";@import "fumadocs-ui/css/preset.css";+@import "tw-animate-css";++@custom-variant dark (&:is(.dark *));:root {- --color-fd-primary: rgb(16 185 129); /* emerald-500 */+ --color-fd-primary: rgb(16 185 129); /* emerald-500 */ --radius: 0.625rem; --background: oklch(1 0 0); --foreground: oklch(0.145 0 0); --card: oklch(1 0 0); --card-foreground: oklch(0.145 0 0); --popover: oklch(1 0 0); --popover-foreground: oklch(0.145 0 0); --primary: oklch(0.205 0 0); --primary-foreground: oklch(0.985 0 0); --secondary: oklch(0.97 0 0); --secondary-foreground: oklch(0.205 0 0); --muted: oklch(0.97 0 0); --muted-foreground: oklch(0.556 0 0); --accent: oklch(0.97 0 0); --accent-foreground: oklch(0.205 0 0); --destructive: oklch(0.577 0.245 27.325); --border: oklch(0.922 0 0); --input: oklch(0.922 0 0); --ring: oklch(0.708 0 0); --chart-1: oklch(0.646 0.222 41.116); --chart-2: oklch(0.6 0.118 184.704); --chart-3: oklch(0.398 0.07 227.392); --chart-4: oklch(0.828 0.189 84.429); --chart-5: oklch(0.769 0.188 70.08); --sidebar: oklch(0.985 0 0); --sidebar-foreground: oklch(0.145 0 0); --sidebar-primary: oklch(0.205 0 0); --sidebar-primary-foreground: oklch(0.985 0 0); --sidebar-accent: oklch(0.97 0 0); --sidebar-accent-foreground: oklch(0.205 0 0); --sidebar-border: oklch(0.922 0 0); --sidebar-ring: oklch(0.708 0 0);}.dark {- --color-fd-primary: rgb(16 185 129); /* emerald-500 */+ --color-fd-primary: rgb(16 185 129); /* emerald-500 */ --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0); --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0); --popover: oklch(0.205 0 0); --popover-foreground: oklch(0.985 0 0); --primary: oklch(0.922 0 0); --primary-foreground: oklch(0.205 0 0); --secondary: oklch(0.269 0 0); --secondary-foreground: oklch(0.985 0 0); --muted: oklch(0.269 0 0); --muted-foreground: oklch(0.708 0 0); --accent: oklch(0.269 0 0); --accent-foreground: oklch(0.985 0 0); --destructive: oklch(0.704 0.191 22.216); --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.556 0 0); --chart-1: oklch(0.488 0.243 264.376); --chart-2: oklch(0.696 0.17 162.48); --chart-3: oklch(0.769 0.188 70.08); --chart-4: oklch(0.627 0.265 303.9); --chart-5: oklch(0.645 0.246 16.439); --sidebar: oklch(0.205 0 0); --sidebar-foreground: oklch(0.985 0 0); --sidebar-primary: oklch(0.488 0.243 264.376); --sidebar-primary-foreground: oklch(0.985 0 0); --sidebar-accent: oklch(0.269 0 0); --sidebar-accent-foreground: oklch(0.985 0 0); --sidebar-border: oklch(1 0 0 / 10%); --sidebar-ring: oklch(0.556 0 0);}body {@@ -86,3 +91,53 @@ pre {padding-inline-start: 0 !important;margin-left: 0 !important;}++@theme inline {+ --radius-sm: calc(var(--radius) - 4px);+ --radius-md: calc(var(--radius) - 2px);+ --radius-lg: var(--radius);+ --radius-xl: calc(var(--radius) + 4px);+ --radius-2xl: calc(var(--radius) + 8px);+ --radius-3xl: calc(var(--radius) + 12px);+ --radius-4xl: calc(var(--radius) + 16px);+ --color-background: var(--background);+ --color-foreground: var(--foreground);+ --color-card: var(--card);+ --color-card-foreground: var(--card-foreground);+ --color-popover: var(--popover);+ --color-popover-foreground: var(--popover-foreground);+ --color-primary: var(--primary);+ --color-primary-foreground: var(--primary-foreground);+ --color-secondary: var(--secondary);+ --color-secondary-foreground: var(--secondary-foreground);+ --color-muted: var(--muted);+ --color-muted-foreground: var(--muted-foreground);+ --color-accent: var(--accent);+ --color-accent-foreground: var(--accent-foreground);+ --color-destructive: var(--destructive);+ --color-border: var(--border);+ --color-input: var(--input);+ --color-ring: var(--ring);+ --color-chart-1: var(--chart-1);+ --color-chart-2: var(--chart-2);+ --color-chart-3: var(--chart-3);+ --color-chart-4: var(--chart-4);+ --color-chart-5: var(--chart-5);+ --color-sidebar: var(--sidebar);+ --color-sidebar-foreground: var(--sidebar-foreground);+ --color-sidebar-primary: var(--sidebar-primary);+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);+ --color-sidebar-accent: var(--sidebar-accent);+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);+ --color-sidebar-border: var(--sidebar-border);+ --color-sidebar-ring: var(--sidebar-ring);+}++@layer base {+ * {+ @apply border-border outline-ring/50;+ }+ body {+ @apply bg-background text-foreground;+ }+}diff --git a/docs/src/components/Footer.tsx b/docs/src/components/Footer.tsxindex 47567e6d6..ce70779bb 100644--- a/docs/src/components/Footer.tsx+++ b/docs/src/components/Footer.tsx@@ -3,7 +3,7 @@ import Link from "next/link";export function Footer() {return (- <footer className="border-t border-neutral-200 dark:border-neutral-700">+ <footer className="border-t border-neutral-200 dark:border-neutral-800"><div className="max-w-[1200px] mx-auto px-4 py-12">{/* Main Footer Content */}<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 mb-8">@@ -223,7 +223,7 @@ export function Footer() {</div>{/* Bottom Bar */}- <div className="pt-8 border-t border-neutral-200 dark:border-neutral-700">+ <div className="pt-8 border-t border-neutral-200 dark:border-neutral-800"><div className="flex flex-col md:flex-row items-center justify-between gap-4"><div className="text-sm text-neutral-400">© {new Date().getFullYear()} Rybbit. All rights reserved.</div><div className="text-sm text-neutral-400">diff --git a/docs/src/components/ui/activity.tsx b/docs/src/components/ui/activity.tsxnew file mode 100644index 000000000..d5ed61cd2--- /dev/null+++ b/docs/src/components/ui/activity.tsx@@ -0,0 +1,109 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface ActivityIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface ActivityIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const VARIANTS: Variants = {+ normal: {+ opacity: 1,+ pathLength: 1,+ pathOffset: 0,+ transition: {+ duration: 0.4,+ opacity: { duration: 0.1 },+ },+ },+ animate: {+ opacity: [0, 1],+ pathLength: [0, 1],+ pathOffset: [1, 0],+ transition: {+ duration: 0.6,+ ease: "linear",+ opacity: { duration: 0.1 },+ },+ },+};++const ActivityIcon = forwardRef<ActivityIconHandle, ActivityIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.path+ animate={controls}+ d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"+ initial="normal"+ variants={VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++ActivityIcon.displayName = "ActivityIcon";++export { ActivityIcon };diff --git a/docs/src/components/ui/arrow-down.tsx b/docs/src/components/ui/arrow-down.tsxnew file mode 100644index 000000000..5619a0df7--- /dev/null+++ b/docs/src/components/ui/arrow-down.tsx@@ -0,0 +1,112 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface ArrowDownIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface ArrowDownIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const PATH_VARIANTS: Variants = {+ normal: { d: "m19 12-7 7-7-7", translateY: 0 },+ animate: {+ d: "m19 12-7 7-7-7",+ translateY: [0, -3, 0],+ transition: {+ duration: 0.4,+ },+ },+};++const SECOND_PATH_VARIANTS: Variants = {+ normal: { d: "M12 5v14" },+ animate: {+ d: ["M12 5v14", "M12 5v9", "M12 5v14"],+ transition: {+ duration: 0.4,+ },+ },+};++const ArrowDownIcon = forwardRef<ArrowDownIconHandle, ArrowDownIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.path+ animate={controls}+ d="m19 12-7 7-7-7"+ variants={PATH_VARIANTS}+ />+ <motion.path+ animate={controls}+ d="M12 5v14"+ variants={SECOND_PATH_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++ArrowDownIcon.displayName = "ArrowDownIcon";++export { ArrowDownIcon };diff --git a/docs/src/components/ui/ban.tsx b/docs/src/components/ui/ban.tsxnew file mode 100644index 000000000..585f26e93--- /dev/null+++ b/docs/src/components/ui/ban.tsx@@ -0,0 +1,137 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface BanIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface BanIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const CIRCLE_VARIANTS: Variants = {+ normal: {+ opacity: 1,+ pathLength: 1,+ transition: {+ duration: 0.3,+ opacity: { duration: 0.1 },+ },+ },+ animate: {+ opacity: [0, 1],+ pathLength: [0, 1],+ transition: {+ duration: 0.4,+ opacity: { duration: 0.1 },+ },+ },+};++const LINE_VARIANTS: Variants = {+ normal: {+ opacity: 1,+ pathLength: 1,+ transition: {+ duration: 0.3,+ opacity: { duration: 0.1 },+ },+ },+ slash: () => ({+ opacity: [0, 1],+ pathLength: [0, 1],+ transition: {+ duration: 0.4,+ opacity: { duration: 0.1 },+ },+ }),+};++const BanIcon = forwardRef<BanIconHandle, BanIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => {+ controls.start("animate");+ controls.start("slash", { delay: 0.5 });+ },+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ controls.start("slash", { delay: 0.5 });+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.circle+ animate={controls}+ cx="12"+ cy="12"+ initial="normal"+ r="10"+ variants={CIRCLE_VARIANTS}+ />+ <motion.path+ animate={controls}+ d="m4.9 4.9 14.2 14.2"+ initial="normal"+ variants={LINE_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++BanIcon.displayName = "BanIcon";++export { BanIcon };diff --git a/docs/src/components/ui/bell.tsx b/docs/src/components/ui/bell.tsxnew file mode 100644index 000000000..5fe6817dd--- /dev/null+++ b/docs/src/components/ui/bell.tsx@@ -0,0 +1,93 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface BellIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface BellIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const SVG_VARIANTS: Variants = {+ normal: { rotate: 0 },+ animate: { rotate: [0, -10, 10, -10, 0] },+};++const BellIcon = forwardRef<BellIconHandle, BellIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );+ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <motion.svg+ animate={controls}+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ transition={{+ duration: 0.5,+ ease: "easeInOut",+ }}+ variants={SVG_VARIANTS}+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />+ <path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />+ </motion.svg>+ </div>+ );+ }+);++BellIcon.displayName = "BellIcon";++export { BellIcon };diff --git a/docs/src/components/ui/bot.tsx b/docs/src/components/ui/bot.tsxnew file mode 100644index 000000000..4e93f6ae9--- /dev/null+++ b/docs/src/components/ui/bot.tsx@@ -0,0 +1,122 @@+"use client";++import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface BotIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface BotIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const BotIcon = forwardRef<BotIconHandle, BotIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M12 8V4H8" />+ <rect height="12" rx="2" width="16" x="4" y="8" />+ <path d="M2 14h2" />+ <path d="M20 14h2" />++ <motion.line+ animate={controls}+ initial="normal"+ variants={{+ normal: { y1: 13, y2: 15 },+ animate: {+ y1: [13, 14, 13],+ y2: [15, 14, 15],+ transition: {+ duration: 0.5,+ ease: "easeInOut",+ delay: 0.2,+ },+ },+ }}+ x1={15}+ x2={15}+ />++ <motion.line+ animate={controls}+ initial="normal"+ variants={{+ normal: { y1: 13, y2: 15 },+ animate: {+ y1: [13, 14, 13],+ y2: [15, 14, 15],+ transition: {+ duration: 0.5,+ ease: "easeInOut",+ delay: 0.2,+ },+ },+ }}+ x1={9}+ x2={9}+ />+ </svg>+ </div>+ );+ }+);++BotIcon.displayName = "Bot";++export { BotIcon };diff --git a/docs/src/components/ui/chart-line.tsx b/docs/src/components/ui/chart-line.tsxnew file mode 100644index 000000000..931356b9a--- /dev/null+++ b/docs/src/components/ui/chart-line.tsx@@ -0,0 +1,103 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface ChartLineIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface ChartLineIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const VARIANTS: Variants = {+ normal: {+ pathLength: 1,+ opacity: 1,+ },+ animate: {+ pathLength: [0, 1],+ opacity: [0, 1],+ transition: {+ delay: 0.15,+ duration: 0.3,+ opacity: { delay: 0.1 },+ },+ },+};++const ChartLineIcon = forwardRef<ChartLineIconHandle, ChartLineIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M3 3v16a2 2 0 0 0 2 2h16" />+ <motion.path+ animate={controls}+ d="m7 13 3-3 4 4 5-5"+ variants={VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++ChartLineIcon.displayName = "ChartLineIcon";++export { ChartLineIcon };diff --git a/docs/src/components/ui/circle-check.tsx b/docs/src/components/ui/circle-check.tsxnew file mode 100644index 000000000..8e6690888--- /dev/null+++ b/docs/src/components/ui/circle-check.tsx@@ -0,0 +1,107 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface CircleCheckIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface CircleCheckIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const PATH_VARIANTS: Variants = {+ normal: {+ opacity: 1,+ pathLength: 1,+ transition: {+ duration: 0.3,+ opacity: { duration: 0.1 },+ },+ },+ animate: {+ opacity: [0, 1],+ pathLength: [0, 1],+ transition: {+ duration: 0.4,+ opacity: { duration: 0.1 },+ },+ },+};++const CircleCheckIcon = forwardRef<CircleCheckIconHandle, CircleCheckIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <circle cx="12" cy="12" r="10" />+ <motion.path+ animate={controls}+ d="m9 12 2 2 4-4"+ initial="normal"+ variants={PATH_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++CircleCheckIcon.displayName = "CircleCheckIcon";++export { CircleCheckIcon };diff --git a/docs/src/components/ui/download.tsx b/docs/src/components/ui/download.tsxnew file mode 100644index 000000000..db83e5142--- /dev/null+++ b/docs/src/components/ui/download.tsx@@ -0,0 +1,99 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface DownloadIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface DownloadIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const ARROW_VARIANTS: Variants = {+ normal: { y: 0 },+ animate: {+ y: 2,+ transition: {+ type: "spring",+ stiffness: 200,+ damping: 10,+ mass: 1,+ },+ },+};++const DownloadIcon = forwardRef<DownloadIconHandle, DownloadIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />+ <motion.g animate={controls} variants={ARROW_VARIANTS}>+ <polyline points="7 10 12 15 17 10" />+ <line x1="12" x2="12" y1="15" y2="3" />+ </motion.g>+ </svg>+ </div>+ );+ }+);++DownloadIcon.displayName = "DownloadIcon";++export { DownloadIcon };diff --git a/docs/src/components/ui/earth.tsx b/docs/src/components/ui/earth.tsxnew file mode 100644index 000000000..c4f17b2d0--- /dev/null+++ b/docs/src/components/ui/earth.tsx@@ -0,0 +1,157 @@+"use client";++import type { Transition, Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface EarthIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface EarthIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const CIRCLE_TRANSITION: Transition = {+ duration: 0.3,+ delay: 0.1,+ opacity: { delay: 0.15 },+};++const CIRCLE_VARIANTS: Variants = {+ normal: {+ pathLength: 1,+ opacity: 1,+ },+ animate: {+ pathLength: [0, 1],+ opacity: [0, 1],+ },+};++const EarthIcon = forwardRef<EarthIconHandle, EarthIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.path+ animate={controls}+ d="M21.54 15H17a2 2 0 0 0-2 2v4.54"+ transition={{ duration: 0.7, delay: 0.5, opacity: { delay: 0.5 } }}+ variants={{+ normal: {+ pathLength: 1,+ opacity: 1,+ pathOffset: 0,+ },+ animate: {+ pathLength: [0, 1],+ opacity: [0, 1],+ pathOffset: [1, 0],+ },+ }}+ />+ <motion.path+ animate={controls}+ d="M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17"+ transition={{ duration: 0.7, delay: 0.5, opacity: { delay: 0.5 } }}+ variants={{+ normal: {+ pathLength: 1,+ opacity: 1,+ pathOffset: 0,+ },+ animate: {+ pathLength: [0, 1],+ opacity: [0, 1],+ pathOffset: [1, 0],+ },+ }}+ />+ <motion.path+ animate={controls}+ d="M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"+ transition={{ duration: 0.7, delay: 0.5, opacity: { delay: 0.5 } }}+ variants={{+ normal: {+ pathLength: 1,+ opacity: 1,+ pathOffset: 0,+ },+ animate: {+ pathLength: [0, 1],+ opacity: [0, 1],+ pathOffset: [1, 0],+ },+ }}+ />+ <motion.circle+ animate={controls}+ cx="12"+ cy="12"+ r="10"+ transition={CIRCLE_TRANSITION}+ variants={CIRCLE_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++EarthIcon.displayName = "EarthIcon";++export { EarthIcon };diff --git a/docs/src/components/ui/gauge.tsx b/docs/src/components/ui/gauge.tsxnew file mode 100644index 000000000..cd72682fb--- /dev/null+++ b/docs/src/components/ui/gauge.tsx@@ -0,0 +1,102 @@+"use client";++import type { Transition } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface GaugeIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface GaugeIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const DEFAULT_TRANSITION: Transition = {+ type: "spring",+ stiffness: 160,+ damping: 17,+ mass: 1,+};++const GaugeIcon = forwardRef<GaugeIconHandle, GaugeIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.path+ animate={controls}+ d="m12 14 4-4"+ transition={DEFAULT_TRANSITION}+ variants={{+ animate: { translateX: 0.5, translateY: 3, rotate: 72 },+ normal: {+ translateX: 0,+ rotate: 0,+ translateY: 0,+ },+ }}+ />+ <path d="M3.34 19a10 10 0 1 1 17.32 0" />+ </svg>+ </div>+ );+ }+);++GaugeIcon.displayName = "GaugeIcon";++export { GaugeIcon };diff --git a/docs/src/components/ui/layers.tsx b/docs/src/components/ui/layers.tsxnew file mode 100644index 000000000..56ad1e145--- /dev/null+++ b/docs/src/components/ui/layers.tsx@@ -0,0 +1,113 @@+"use client";++import type { Transition } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface LayersIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface LayersIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const DEFAULT_TRANSITION: Transition = {+ type: "spring",+ stiffness: 100,+ damping: 14,+ mass: 1,+};++const LayersIcon = forwardRef<LayersIconHandle, LayersIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: async () => {+ await controls.start("firstState");+ await controls.start("secondState");+ },+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ async (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ await controls.start("firstState");+ await controls.start("secondState");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" />+ <motion.path+ animate={controls}+ d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"+ transition={DEFAULT_TRANSITION}+ variants={{+ normal: { y: 0 },+ firstState: { y: -9 },+ secondState: { y: 0 },+ }}+ />+ <motion.path+ animate={controls}+ d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"+ transition={DEFAULT_TRANSITION}+ variants={{+ normal: { y: 0 },+ firstState: { y: -5 },+ secondState: { y: 0 },+ }}+ />+ </svg>+ </div>+ );+ }+);++LayersIcon.displayName = "LayersIcon";++export { LayersIcon };diff --git a/docs/src/components/ui/link.tsx b/docs/src/components/ui/link.tsxnew file mode 100644index 000000000..9d5d2f1d7--- /dev/null+++ b/docs/src/components/ui/link.tsx@@ -0,0 +1,107 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface LinkIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface LinkIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const PATH_VARIANTS: Variants = {+ initial: { pathLength: 1, pathOffset: 0, rotate: 0 },+ animate: {+ pathLength: [1, 0.97, 1, 0.97, 1],+ pathOffset: [0, 0.05, 0, 0.05, 0],+ rotate: [0, -5, 0],+ transition: {+ rotate: {+ duration: 0.5,+ },+ duration: 1,+ times: [0, 0.2, 0.4, 0.6, 1],+ ease: "easeInOut",+ },+ },+};++const LinkIcon = forwardRef<LinkIconHandle, LinkIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );+ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.path+ animate={controls}+ d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"+ variants={PATH_VARIANTS}+ />+ <motion.path+ animate={controls}+ d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"+ variants={PATH_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++LinkIcon.displayName = "LinkIcon";++export { LinkIcon };diff --git a/docs/src/components/ui/play.tsx b/docs/src/components/ui/play.tsxnew file mode 100644index 000000000..ac1948c30--- /dev/null+++ b/docs/src/components/ui/play.tsx@@ -0,0 +1,102 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface PlayIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface PlayIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const PATH_VARIANTS: Variants = {+ normal: {+ x: 0,+ rotate: 0,+ },+ animate: {+ x: [0, -1, 2, 0],+ rotate: [0, -10, 0, 0],+ transition: {+ duration: 0.5,+ times: [0, 0.2, 0.5, 1],+ stiffness: 260,+ damping: 20,+ },+ },+};++const PlayIcon = forwardRef<PlayIconHandle, PlayIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );+ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <motion.svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.polygon+ animate={controls}+ points="6 3 20 12 6 21 6 3"+ variants={PATH_VARIANTS}+ />+ </motion.svg>+ </div>+ );+ }+);++PlayIcon.displayName = "PlayIcon";++export { PlayIcon };diff --git a/docs/src/components/ui/route.tsx b/docs/src/components/ui/route.tsxnew file mode 100644index 000000000..ae823e22a--- /dev/null+++ b/docs/src/components/ui/route.tsx@@ -0,0 +1,131 @@+"use client";++import type { Transition, Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface RouteIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface RouteIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const CIRCLE_TRANSITION: Transition = {+ duration: 0.3,+ delay: 0.1,+ opacity: { delay: 0.15 },+};++const CIRCLE_VARIANTS: Variants = {+ normal: {+ pathLength: 1,+ opacity: 1,+ },+ animate: {+ pathLength: [0, 1],+ opacity: [0, 1],+ },+};++const RouteIcon = forwardRef<RouteIconHandle, RouteIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.circle+ animate={controls}+ cx="6"+ cy="19"+ r="3"+ transition={CIRCLE_TRANSITION}+ variants={CIRCLE_VARIANTS}+ />+ <motion.path+ animate={controls}+ d="M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"+ transition={{ duration: 0.7, delay: 0.5, opacity: { delay: 0.5 } }}+ variants={{+ normal: {+ pathLength: 1,+ opacity: 1,+ pathOffset: 0,+ },+ animate: {+ pathLength: [0, 1],+ opacity: [0, 1],+ pathOffset: [1, 0],+ },+ }}+ />+ <motion.circle+ animate={controls}+ cx="18"+ cy="5"+ r="3"+ transition={CIRCLE_TRANSITION}+ variants={CIRCLE_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++RouteIcon.displayName = "RouteIcon";++export { RouteIcon };diff --git a/docs/src/components/ui/shield-check.tsx b/docs/src/components/ui/shield-check.tsxnew file mode 100644index 000000000..b2a9425e5--- /dev/null+++ b/docs/src/components/ui/shield-check.tsx@@ -0,0 +1,109 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface ShieldCheckIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface ShieldCheckIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const PATH_VARIANTS: Variants = {+ normal: {+ opacity: 1,+ pathLength: 1,+ scale: 1,+ transition: {+ duration: 0.3,+ opacity: { duration: 0.1 },+ },+ },+ animate: {+ opacity: [0, 1],+ pathLength: [0, 1],+ scale: [0.5, 1],+ transition: {+ duration: 0.4,+ opacity: { duration: 0.1 },+ },+ },+};++const ShieldCheckIcon = forwardRef<ShieldCheckIconHandle, ShieldCheckIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />+ <motion.path+ animate={controls}+ d="m9 12 2 2 4-4"+ initial="normal"+ variants={PATH_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++ShieldCheckIcon.displayName = "ShieldCheckIcon";++export { ShieldCheckIcon };diff --git a/docs/src/components/ui/sparkles.tsx b/docs/src/components/ui/sparkles.tsxnew file mode 100644index 000000000..7fe040fa8--- /dev/null+++ b/docs/src/components/ui/sparkles.tsx@@ -0,0 +1,148 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface SparklesIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface SparklesIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const SPARKLE_VARIANTS: Variants = {+ initial: {+ y: 0,+ fill: "none",+ },+ hover: {+ y: [0, -1, 0, 0],+ fill: "currentColor",+ transition: {+ duration: 1,+ bounce: 0.3,+ },+ },+};++const STAR_VARIANTS: Variants = {+ initial: {+ opacity: 1,+ x: 0,+ y: 0,+ },+ blink: () => ({+ opacity: [0, 1, 0, 0, 0, 0, 1],+ transition: {+ duration: 2,+ type: "spring",+ stiffness: 70,+ damping: 10,+ mass: 0.4,+ },+ }),+};++const SparklesIcon = forwardRef<SparklesIconHandle, SparklesIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const starControls = useAnimation();+ const sparkleControls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => {+ sparkleControls.start("hover");+ starControls.start("blink", { delay: 1 });+ },+ stopAnimation: () => {+ sparkleControls.start("initial");+ starControls.start("initial");+ },+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ sparkleControls.start("hover");+ starControls.start("blink", { delay: 1 });+ }+ },+ [onMouseEnter, sparkleControls, starControls]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ sparkleControls.start("initial");+ starControls.start("initial");+ }+ },+ [sparkleControls, starControls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.path+ animate={sparkleControls}+ d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"+ variants={SPARKLE_VARIANTS}+ />+ <motion.path+ animate={starControls}+ d="M20 3v4"+ variants={STAR_VARIANTS}+ />+ <motion.path+ animate={starControls}+ d="M22 5h-4"+ variants={STAR_VARIANTS}+ />+ <motion.path+ animate={starControls}+ d="M4 17v2"+ variants={STAR_VARIANTS}+ />+ <motion.path+ animate={starControls}+ d="M5 18H3"+ variants={STAR_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++SparklesIcon.displayName = "SparklesIcon";++export { SparklesIcon };diff --git a/docs/src/components/ui/terminal.tsx b/docs/src/components/ui/terminal.tsxnew file mode 100644index 000000000..d4548b389--- /dev/null+++ b/docs/src/components/ui/terminal.tsx@@ -0,0 +1,103 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface TerminalIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface TerminalIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const LINE_VARIANTS: Variants = {+ normal: { opacity: 1 },+ animate: {+ opacity: [1, 0, 1],+ transition: {+ duration: 0.8,+ repeat: Number.POSITIVE_INFINITY,+ ease: "linear",+ },+ },+};++const TerminalIcon = forwardRef<TerminalIconHandle, TerminalIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <polyline points="4 17 10 11 4 5" />+ <motion.line+ animate={controls}+ initial="normal"+ variants={LINE_VARIANTS}+ x1="12"+ x2="20"+ y1="19"+ y2="19"+ />+ </svg>+ </div>+ );+ }+);++TerminalIcon.displayName = "TerminalIcon";++export { TerminalIcon };diff --git a/docs/src/components/ui/users.tsx b/docs/src/components/ui/users.tsxnew file mode 100644index 000000000..d194a6e77--- /dev/null+++ b/docs/src/components/ui/users.tsx@@ -0,0 +1,113 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface UsersIconHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface UsersIconProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const PATH_VARIANTS: Variants = {+ normal: {+ translateX: 0,+ transition: {+ type: "spring",+ stiffness: 200,+ damping: 13,+ },+ },+ animate: {+ translateX: [-6, 0],+ transition: {+ delay: 0.1,+ type: "spring",+ stiffness: 200,+ damping: 13,+ },+ },+};++const UsersIcon = forwardRef<UsersIconHandle, UsersIconProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />+ <circle cx="9" cy="7" r="4" />+ <motion.path+ animate={controls}+ d="M22 21v-2a4 4 0 0 0-3-3.87"+ variants={PATH_VARIANTS}+ />+ <motion.path+ animate={controls}+ d="M16 3.13a4 4 0 0 1 0 7.75"+ variants={PATH_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++UsersIcon.displayName = "UsersIcon";++export { UsersIcon };diff --git a/docs/src/components/ui/zap.tsx b/docs/src/components/ui/zap.tsxnew file mode 100644index 000000000..76c6b25a8--- /dev/null+++ b/docs/src/components/ui/zap.tsx@@ -0,0 +1,105 @@+"use client";++import type { Variants } from "motion/react";+import { motion, useAnimation } from "motion/react";+import type { HTMLAttributes } from "react";+import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";++import { cn } from "@/lib/utils";++export interface ZapHandle {+ startAnimation: () => void;+ stopAnimation: () => void;+}++interface ZapProps extends HTMLAttributes<HTMLDivElement> {+ size?: number;+}++const PATH_VARIANTS: Variants = {+ normal: {+ opacity: 1,+ pathLength: 1,+ transition: {+ duration: 0.6,+ opacity: { duration: 0.1 },+ },+ },+ animate: {+ opacity: [0, 1],+ pathLength: [0, 1],+ transition: {+ duration: 0.6,+ opacity: { duration: 0.1 },+ },+ },+};++const ZapIcon = forwardRef<ZapHandle, ZapProps>(+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {+ const controls = useAnimation();+ const isControlledRef = useRef(false);++ useImperativeHandle(ref, () => {+ isControlledRef.current = true;++ return {+ startAnimation: () => controls.start("animate"),+ stopAnimation: () => controls.start("normal"),+ };+ });++ const handleMouseEnter = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseEnter?.(e);+ } else {+ controls.start("animate");+ }+ },+ [controls, onMouseEnter]+ );++ const handleMouseLeave = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (isControlledRef.current) {+ onMouseLeave?.(e);+ } else {+ controls.start("normal");+ }+ },+ [controls, onMouseLeave]+ );++ return (+ <div+ className={cn(className)}+ onMouseEnter={handleMouseEnter}+ onMouseLeave={handleMouseLeave}+ {...props}+ >+ <svg+ fill="none"+ height={size}+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <motion.path+ animate={controls}+ d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"+ variants={PATH_VARIANTS}+ />+ </svg>+ </div>+ );+ }+);++ZapIcon.displayName = "ZapIcon";++export { ZapIcon };diff --git a/docs/src/lib/utils.ts b/docs/src/lib/utils.tsindex a5ef19350..bd0c391dd 100644--- a/docs/src/lib/utils.ts+++ b/docs/src/lib/utils.ts@@ -1,6 +1,6 @@-import { clsx, type ClassValue } from "clsx";-import { twMerge } from "tailwind-merge";+import { clsx, type ClassValue } from "clsx"+import { twMerge } from "tailwind-merge"export function cn(...inputs: ClassValue[]) {- return twMerge(clsx(inputs));+ return twMerge(clsx(inputs))}