27 lines
2.7 KiB
JSON
27 lines
2.7 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "clock-icon",
|
|
"type": "registry:ui",
|
|
"title": "Clock Icon",
|
|
"description": "Clock icon component.",
|
|
"dependencies": [
|
|
"motion"
|
|
],
|
|
"files": [
|
|
{
|
|
"path": "registry/icons/clock/index.tsx",
|
|
"content": "'use client';\n\nimport * as React from 'react';\nimport { motion, type Variants } from 'motion/react';\n\nimport {\n getVariants,\n useAnimateIconContext,\n IconWrapper,\n type IconProps,\n} from '@/components/animate-ui/icons/icon';\n\ntype ClockProps = IconProps<keyof typeof animations>;\n\nconst animations = {\n default: {\n circle: {},\n line1: {\n initial: {\n rotate: 0,\n transition: { ease: 'easeInOut', duration: 0.6 },\n },\n animate: {\n transformOrigin: 'top left',\n rotate: [0, 20, 0],\n transition: { ease: 'easeInOut', duration: 0.6 },\n },\n },\n line2: {\n initial: {\n rotate: 0,\n transition: { ease: 'easeInOut', duration: 0.6 },\n },\n animate: {\n transformOrigin: 'bottom left',\n rotate: 360,\n transition: { ease: 'easeInOut', duration: 0.6 },\n },\n },\n } satisfies Record<string, Variants>,\n} as const;\n\nfunction IconComponent({ size, ...props }: ClockProps) {\n const { controls } = useAnimateIconContext();\n const variants = getVariants(animations);\n\n return (\n <motion.svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <motion.circle\n cx={12}\n cy={12}\n r={10}\n variants={variants.circle}\n initial=\"initial\"\n animate={controls}\n />\n <motion.line\n x1={12}\n y1={12}\n x2={16}\n y2={14}\n variants={variants.line1}\n initial=\"initial\"\n animate={controls}\n />\n <motion.line\n x1={12}\n y1={6}\n x2={12}\n y2={12}\n variants={variants.line2}\n initial=\"initial\"\n animate={controls}\n />\n </motion.svg>\n );\n}\n\nfunction Clock(props: ClockProps) {\n return <IconWrapper icon={IconComponent} {...props} />;\n}\n\nexport {\n animations,\n Clock,\n Clock as ClockIcon,\n type ClockProps,\n type ClockProps as ClockIconProps,\n};\n",
|
|
"type": "registry:ui",
|
|
"target": "components/animate-ui/icons/clock.tsx"
|
|
}
|
|
],
|
|
"meta": {
|
|
"keywords": [
|
|
"clock",
|
|
"time",
|
|
"watch",
|
|
"alarm",
|
|
"timer"
|
|
]
|
|
}
|
|
} |