Initial commit
This commit is contained in:
18
src_frontend_orig/components/Button.jsx
Normal file
18
src_frontend_orig/components/Button.jsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { motion, useReducedMotion } from 'framer-motion';
|
||||
|
||||
export function Button({ variant = 'primary', className = '', children, ...props }) {
|
||||
const reduceMotion = useReducedMotion();
|
||||
const variantClass =
|
||||
variant === 'ghost' ? 'btn-ghost' : variant === 'primary' ? 'btn-primary' : '';
|
||||
const combined = ['btn', variantClass, className].filter(Boolean).join(' ');
|
||||
return (
|
||||
<motion.button
|
||||
className={combined}
|
||||
whileHover={reduceMotion ? undefined : { y: -1, boxShadow: '0 4px 12px rgba(0,0,0,0.2)' }}
|
||||
whileTap={reduceMotion ? undefined : { scale: 0.98 }}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</motion.button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user