diff --git a/src/components/aceternity/input.tsx b/src/components/aceternity/input.tsx new file mode 100644 index 0000000..4864b03 --- /dev/null +++ b/src/components/aceternity/input.tsx @@ -0,0 +1,61 @@ +// Input component extends from shadcnui - https://ui.shadcn.com/docs/components/input +'use client' +import { motion, useMotionTemplate, useMotionValue } from 'framer-motion' +import { forwardRef, useState } from 'react' +import { cn } from '@/components/utils/cn' + +export interface InputProps + extends React.InputHTMLAttributes { } + +const Input = forwardRef( + ({ className, type, ...props }, ref) => { + const radius = 100 // change this to increase the rdaius of the hover effect + const [visible, setVisible] = useState(false) + + const mouseX = useMotionValue(0) + const mouseY = useMotionValue(0) + + function handleMouseMove({ currentTarget, clientX, clientY }: any) { + const { left, top } = currentTarget.getBoundingClientRect() + + mouseX.set(clientX - left) + mouseY.set(clientY - top) + } + return ( + setVisible(true)} + onMouseLeave={() => setVisible(false)} + className="p-[2px] rounded-lg transition duration-300 group/input" + > + + + ) + }, +) +Input.displayName = 'Input' + +export { Input } diff --git a/src/components/aceternity/label.tsx b/src/components/aceternity/label.tsx new file mode 100644 index 0000000..e10a7ef --- /dev/null +++ b/src/components/aceternity/label.tsx @@ -0,0 +1,25 @@ +// Label component extends from shadcnui - https://ui.shadcn.com/docs/components/label + +'use client' +import * as LabelPrimitive from '@radix-ui/react-label' + +import type { ComponentPropsWithoutRef, ElementRef } from 'react' +import { forwardRef } from 'react' +import { cn } from '@/components/utils/cn' + +const Label = forwardRef< + ElementRef, + ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +Label.displayName = LabelPrimitive.Root.displayName + +export { Label } diff --git a/src/components/aceternity/text-area.tsx b/src/components/aceternity/text-area.tsx new file mode 100644 index 0000000..ebb2c9b --- /dev/null +++ b/src/components/aceternity/text-area.tsx @@ -0,0 +1,71 @@ +// Not originally from Aceternity, but uses the styles from the input component +import * as React from 'react' +import { motion, useMotionTemplate, useMotionValue } from 'framer-motion' +import { cn } from '@/components/utils/cn' + +export interface TextareaProps + extends React.TextareaHTMLAttributes { } + +const Textarea = React.forwardRef( + ({ className, ...props }, ref) => { + const radius = 100 // change this to increase the radius of the hover effect + const [visible, setVisible] = React.useState(false) + + const mouseX = useMotionValue(0) + const mouseY = useMotionValue(0) + + function handleMouseMove({ currentTarget, clientX, clientY }: any) { + const { left, top } = currentTarget.getBoundingClientRect() + + mouseX.set(clientX - left) + mouseY.set(clientY - top) + } + + return ( + //