'use client'; import * as React from 'react'; import { motion, AnimatePresence, type HTMLMotionProps, type Transition, } from 'motion/react'; import { cn } from '@workspace/ui/lib/utils'; const sizes = { default: 'size-8 [&_svg]:size-5', sm: 'size-6 [&_svg]:size-4', md: 'size-10 [&_svg]:size-6', lg: 'size-12 [&_svg]:size-7', }; type IconButtonProps = Omit, 'color'> & { icon: React.ElementType; active?: boolean; className?: string; animate?: boolean; size?: keyof typeof sizes; color?: [number, number, number]; transition?: Transition; }; function IconButton({ icon: Icon, className, active = false, animate = true, size = 'default', color = [59, 130, 246], transition = { type: 'spring', stiffness: 300, damping: 15 }, ...props }: IconButtonProps) { return ( {active && ( )} {animate && active && ( <> {[...Array(6)].map((_, i) => ( ))} )} ); } export { IconButton, sizes, type IconButtonProps };