{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "activities-card-base",
  "type": "registry:component",
  "title": "Activities Card (base)",
  "description": "Theme-ready base variant of An expandable activities card with smooth spring animations and a premium 3D header aesthetic..",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "files": [
    {
      "path": "components/watermelon/activities-card.tsx",
      "type": "registry:component",
      "content": "'use client';\n\nimport { useState, useEffect, type FC, type ReactNode } from 'react';\nimport { motion, AnimatePresence, MotionConfig } from 'motion/react';\nimport { ChevronUpIcon } from 'lucide-react';\n\nexport interface ActivityItemType {\n  icon: ReactNode;\n  title: string;\n  desc: string;\n  time: string;\n}\n\nexport interface ActivitiesCardProps {\n  headerIcon: ReactNode;\n  title: string;\n  subtitle: string;\n  activities: ActivityItemType[];\n}\n\nconst ActivityItem: FC<ActivityItemType> = ({ icon, title, desc, time }) => {\n  return (\n    <motion.div\n      layout\n      initial={{ opacity: 0, x: -10 }}\n      animate={{ opacity: 1, x: 0 }}\n      className=\"flex cursor-pointer items-center gap-3 px-3 py-3 transition-colors hover:bg-accent/40 sm:gap-4 sm:px-5\"\n    >\n      <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-border bg-muted/50 text-muted-foreground sm:h-12 sm:w-12\">\n        {icon}\n      </div>\n\n      <div className=\"min-w-0 flex-1\">\n        <p className=\"truncate text-sm leading-tight font-bold text-foreground sm:text-base\">\n          {title}\n        </p>\n        <p className=\"truncate text-xs text-muted-foreground sm:text-sm\">\n          {desc}\n        </p>\n      </div>\n\n      <span className=\"pt-1 text-xs whitespace-nowrap text-muted-foreground\">\n        {time}\n      </span>\n    </motion.div>\n  );\n};\n\nexport const ActivitiesCard: FC<ActivitiesCardProps> = ({\n  headerIcon,\n  title,\n  subtitle,\n  activities,\n}) => {\n  const [open, setOpen] = useState(false);\n  const [isMobile, setIsMobile] = useState(false);\n\n  useEffect(() => {\n    const checkMobile = () => setIsMobile(window.innerWidth < 640);\n    checkMobile();\n    window.addEventListener('resize', checkMobile);\n    return () => window.removeEventListener('resize', checkMobile);\n  }, []);\n\n  return (\n    <MotionConfig transition={{ type: 'spring', bounce: 0, duration: 0.6 }}>\n      <motion.div\n        layout\n        className=\"theme-injected w-full max-w-xs overflow-hidden rounded-xl border border-border bg-card text-card-foreground shadow-lg font-sans sm:max-w-sm font-sans\"\n      >\n        <motion.button\n          onClick={() => setOpen(!open)}\n          className=\"flex w-full items-center justify-between gap-2 px-3 py-2 transition-colors sm:gap-3 sm:px-4 sm:py-3.5\"\n        >\n          <div className=\"flex min-w-0 flex-1 items-center gap-3 text-left sm:gap-4\">\n            <motion.div\n              initial={{\n                width: isMobile ? 48 : 60,\n                height: isMobile ? 48 : 60,\n              }}\n              animate={{\n                width: open ? (isMobile ? 36 : 48) : isMobile ? 48 : 60,\n                height: open ? (isMobile ? 36 : 48) : isMobile ? 48 : 60,\n              }}\n              className=\"relative flex shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-muted shadow-sm sm:rounded-xl\"\n            >\n              <motion.span className=\"pointer-events-none absolute inset-0 shadow-inner\" />\n              <motion.div animate={{ scale: open ? 0.7 : 1 }}>\n                {headerIcon}\n              </motion.div>\n            </motion.div>\n\n            <div className=\"flex min-w-0 flex-1 flex-col justify-center\">\n              <motion.p\n                layout\n                className=\"truncate text-base font-bold tracking-tight text-foreground sm:text-lg\"\n              >\n                {title}\n              </motion.p>\n              <AnimatePresence mode=\"popLayout\" initial={false}>\n                {!open && (\n                  <motion.p\n                    initial={{ opacity: 0 }}\n                    animate={{ opacity: 1 }}\n                    transition={{\n                      duration: 0.3,\n                      ease: 'easeOut',\n                    }}\n                    className=\"truncate text-sm tracking-tight text-muted-foreground\"\n                  >\n                    {subtitle}\n                  </motion.p>\n                )}\n              </AnimatePresence>\n            </div>\n          </div>\n\n          <motion.div\n            animate={{ rotate: open ? 180 : 0 }}\n            className=\"flex size-6 shrink-0 items-center justify-center rounded-full bg-secondary text-secondary-foreground shadow-xs\"\n          >\n            <ChevronUpIcon className=\"size-5\" />\n          </motion.div>\n        </motion.button>\n\n        <AnimatePresence>\n          {open && (\n            <motion.div\n              initial={{ opacity: 0, height: 0 }}\n              animate={{ opacity: 1, height: 'auto' }}\n              exit={{ opacity: 0, height: 0 }}\n              className=\"border-t border-border\"\n            >\n              <div className=\"py-2\">\n                {activities.map((item, i) => (\n                  <ActivityItem key={i} {...item} />\n                ))}\n              </div>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </motion.div>\n    </MotionConfig>\n  );\n};\n"
    }
  ]
}
