Fortura/apps/www/public/r/gauge-icon.json
2025-08-20 04:12:49 -06:00

29 lines
2.6 KiB
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "gauge-icon",
"type": "registry:ui",
"title": "Gauge Icon",
"description": "Gauge icon component.",
"dependencies": [
"motion"
],
"files": [
{
"path": "registry/icons/gauge/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 GaugeProps = IconProps<keyof typeof animations>;\n\nconst animations = {\n default: {\n path1: {\n initial: {\n rotate: 0,\n transition: { ease: 'easeInOut', duration: 0.3 },\n },\n animate: {\n transformOrigin: 'bottom left',\n rotate: 70,\n transition: { ease: 'easeInOut', duration: 0.3 },\n },\n },\n path2: {},\n } satisfies Record<string, Variants>,\n 'default-loop': {\n path1: {\n initial: {\n rotate: 0,\n transition: { ease: 'easeInOut', duration: 0.6 },\n },\n animate: {\n transformOrigin: 'bottom left',\n rotate: [0, 70, 0],\n transition: { ease: 'easeInOut', duration: 0.6 },\n },\n },\n path2: {},\n } satisfies Record<string, Variants>,\n} as const;\n\nfunction IconComponent({ size, ...props }: GaugeProps) {\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.path\n d=\"m12 14 4-4\"\n variants={variants.path1}\n initial=\"initial\"\n animate={controls}\n />\n <motion.path\n d=\"M3.34 19a10 10 0 1 1 17.32 0\"\n variants={variants.path2}\n initial=\"initial\"\n animate={controls}\n />\n </motion.svg>\n );\n}\n\nfunction Gauge(props: GaugeProps) {\n return <IconWrapper icon={IconComponent} {...props} />;\n}\n\nexport {\n animations,\n Gauge,\n Gauge as GaugeIcon,\n type GaugeProps,\n type GaugeProps as GaugeIconProps,\n};\n",
"type": "registry:ui",
"target": "components/animate-ui/icons/gauge.tsx"
}
],
"meta": {
"keywords": [
"dashboard",
"dial",
"meter",
"speed",
"pressure",
"measure",
"level"
]
}
}