{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "buttons-animated",
  "title": "Animated buttons",
  "description": "Styled buttons: the Animated set. 5 decorative buttons variations (BounceButton, ScaleButton, SlideButton, RotateButton, BreatheButton) on the ai2 token system, powered by framer-motion, reduced-motion aware and sized sm to xl. Part of the free styled layer.",
  "dependencies": [
    "motion@^12.42.2"
  ],
  "registryDependencies": [
    "@ai2/tokens"
  ],
  "files": [
    {
      "path": "registry/ai2/styled/buttons-animated.tsx",
      "content": "\"use client\"\n\nimport type * as React from \"react\"\nimport { motion, useReducedMotion, type HTMLMotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Animated buttons family: 5 variations, all sized (aligned with the base scale), using framer-motion, taking colour ONLY from semantic tokens and reduced-motion safe. One file = a whole category you own the code for. */\n\nexport type StyledSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\nconst sizes: Record<StyledSize, string> = {\n  sm: \"h-8 gap-1.5 rounded-md px-3 text-sm\",\n  md: \"h-9 gap-2 rounded-lg px-4 text-sm\",\n  lg: \"h-10 gap-2 rounded-lg px-5 text-sm\",\n  xl: \"h-12 gap-2.5 rounded-xl px-6 text-base\",\n}\n\nconst base =\n  \"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden font-medium whitespace-nowrap outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_i]:text-base [&_i]:leading-none\"\n\ntype Props = HTMLMotionProps<\"button\"> & { size?: StyledSize }\n\n/* Bounce: bounces upwards on hover. */\nexport function BounceButton({ className, size = \"md\", children, ...props }: Props) {\n  const reduce = useReducedMotion()\n  return (\n    <motion.button\n      data-slot=\"styled-button\"\n      whileHover={reduce ? undefined : { y: [0, -4, 0] }}\n      whileTap={reduce ? undefined : { scale: 0.95 }}\n      transition={reduce ? undefined : { duration: 0.4, ease: \"easeInOut\" }}\n      className={cn(base, sizes[size], \"bg-primary text-primary-foreground\", className)}\n      {...props}\n    >\n      {children}\n    </motion.button>\n  )\n}\n\n/* Scale: springy growth on hover. */\nexport function ScaleButton({ className, size = \"md\", children, ...props }: Props) {\n  const reduce = useReducedMotion()\n  return (\n    <motion.button\n      data-slot=\"styled-button\"\n      whileHover={reduce ? undefined : { scale: 1.08 }}\n      whileTap={reduce ? undefined : { scale: 0.95 }}\n      transition={{ type: \"spring\", stiffness: 400, damping: 15 }}\n      className={cn(base, sizes[size], \"bg-brand text-brand-foreground\", className)}\n      {...props}\n    >\n      {children}\n    </motion.button>\n  )\n}\n\n/* Slide: a primary surface (token) filling from the bottom on hover; the text stays on top. */\nexport function SlideButton({ className, size = \"md\", children, ...props }: Props) {\n  const reduce = useReducedMotion()\n  return (\n    <motion.button\n      data-slot=\"styled-button\"\n      whileTap={reduce ? undefined : { scale: 0.97 }}\n      transition={{ type: \"spring\", stiffness: 400, damping: 20 }}\n      className={cn(\n        base,\n        sizes[size],\n        \"group border border-primary/30 bg-transparent text-foreground transition-colors duration-(--motion-base) hover:text-primary-foreground\",\n        className\n      )}\n      {...props}\n    >\n      <span\n        aria-hidden=\"true\"\n        className=\"pointer-events-none absolute inset-0 origin-bottom translate-y-full bg-primary transition-transform duration-(--motion-base) ease-(--motion-ease) group-hover:translate-y-0\"\n      />\n      <span className=\"relative flex items-center gap-2\">{children as React.ReactNode}</span>\n    </motion.button>\n  )\n}\n\n/* Rotate: a slight tilt on hover. */\nexport function RotateButton({ className, size = \"md\", children, ...props }: Props) {\n  const reduce = useReducedMotion()\n  return (\n    <motion.button\n      data-slot=\"styled-button\"\n      whileHover={reduce ? undefined : { rotate: -3, scale: 1.03 }}\n      whileTap={reduce ? undefined : { rotate: 0, scale: 0.96 }}\n      transition={{ type: \"spring\", stiffness: 300, damping: 15 }}\n      className={cn(base, sizes[size], \"bg-info text-info-foreground\", className)}\n      {...props}\n    >\n      {children}\n    </motion.button>\n  )\n}\n\n/* Breathe: a continuous breathing scale loop to draw attention. */\nexport function BreatheButton({ className, size = \"md\", children, ...props }: Props) {\n  const reduce = useReducedMotion()\n  return (\n    <motion.button\n      data-slot=\"styled-button\"\n      animate={reduce ? undefined : { scale: [1, 1.04, 1] }}\n      transition={reduce ? undefined : { duration: 2.2, ease: \"easeInOut\", repeat: Infinity }}\n      whileTap={reduce ? undefined : { scale: 0.96 }}\n      className={cn(base, sizes[size], \"bg-primary text-primary-foreground\", className)}\n      {...props}\n    >\n      {children}\n    </motion.button>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/ui/buttons-animated.tsx"
    }
  ],
  "categories": [
    "styled",
    "buttons"
  ],
  "type": "registry:component"
}