2025-08-20 04:12:49 -06:00

78 lines
1.7 KiB
TypeScript

'use client';
import * as React from 'react';
import { motion, type Variants } from 'motion/react';
import {
getVariants,
useAnimateIconContext,
IconWrapper,
type IconProps,
} from '@/registry/icons/icon';
type AxeProps = IconProps<keyof typeof animations>;
const animations = {
default: {
group: {
initial: {
rotate: 0,
},
animate: {
transformOrigin: 'bottom left',
rotate: [0, 25, -5, 0],
},
},
path1: {},
path2: {},
} satisfies Record<string, Variants>,
} as const;
function IconComponent({ size, ...props }: AxeProps) {
const { controls } = useAnimateIconContext();
const variants = getVariants(animations);
return (
<motion.svg
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
variants={variants.group}
initial="initial"
animate={controls}
{...props}
>
<motion.path
d="m14 12-8.381 8.38a1 1 0 0 1-3.001-3L11 9"
variants={variants.path1}
initial="initial"
animate={controls}
/>
<motion.path
d="M15 15.5a.5.5 0 0 0 .5.5A6.5 6.5 0 0 0 22 9.5a.5.5 0 0 0-.5-.5h-1.672a2 2 0 0 1-1.414-.586l-5.062-5.062a1.205 1.205 0 0 0-1.704 0L9.352 5.648a1.205 1.205 0 0 0 0 1.704l5.062 5.062A2 2 0 0 1 15 13.828z"
variants={variants.path2}
initial="initial"
animate={controls}
/>
</motion.svg>
);
}
function Axe(props: AxeProps) {
return <IconWrapper icon={IconComponent} {...props} />;
}
export {
animations,
Axe,
Axe as AxeIcon,
type AxeProps,
type AxeProps as AxeIconProps,
};