{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "revealing-cards-base",
  "type": "registry:component",
  "title": "Revealing Cards (base)",
  "description": "Theme-ready base variant of Interactive micro-interaction component for revealing cards..",
  "dependencies": [
    "framer-motion"
  ],
  "files": [
    {
      "path": "components/watermelon/revealing-cards.tsx",
      "type": "registry:component",
      "content": "'use client';\n\nimport { motion, useMotionValue, type PanInfo } from 'framer-motion';\nimport React, { useState } from 'react';\n\ntype CardData = {\n  id: number;\n  z: number;\n  label: string;\n  date: string;\n  amount: string;\n  accentColor: string;\n};\n\nconst INITIAL_CARDS: CardData[] = [\n  {\n    id: 1,\n    z: 4,\n    label: 'Credit Card',\n    date: 'Wed, 13 May',\n    amount: '$1,200',\n    accentColor: '#ef4444',\n  },\n  {\n    id: 2,\n    z: 3,\n    label: 'Home Loan',\n    date: 'Wed, 13 May',\n    amount: '$2,700',\n    accentColor: '#ef4444',\n  },\n];\n\ninterface CardProps {\n  children: React.ReactNode;\n  updatePosition: () => void;\n}\n\nconst MAX_DRAG = 150;\n\nfunction Card({ children, updatePosition }: CardProps) {\n  const x = useMotionValue(0);\n  const y = useMotionValue(0);\n\n  function handleDragEnd(_: unknown, info: PanInfo) {\n    if (\n      Math.abs(info.offset.x) > MAX_DRAG ||\n      Math.abs(info.offset.y) > MAX_DRAG\n    ) {\n      updatePosition();\n    } else {\n      x.set(0);\n      y.set(0);\n    }\n  }\n\n  return (\n    <motion.div\n      style={{ x, y }}\n      drag\n      dragConstraints={{ top: 0, right: 0, bottom: 0, left: 0 }}\n      dragElastic={0.6}\n      whileTap={{ cursor: 'grabbing' }}\n      onDragEnd={handleDragEnd}\n      className=\"absolute inset-0 cursor-grab\"\n    >\n      {children}\n    </motion.div>\n  );\n}\n\nexport default function SwipeableStackCards() {\n  const [cards, setCards] = useState<CardData[]>(INITIAL_CARDS);\n\n  const updatePosition = (id: number) => {\n    setCards((prev) => {\n      const newCards = [...prev];\n      const index = newCards.findIndex((card) => card.id === id);\n      const [card] = newCards.splice(index, 1);\n      newCards.unshift(card);\n      return newCards;\n    });\n  };\n\n  return (\n    <div className=\"theme-injected  flex min-h-screen items-center justify-center font-sans\">\n      <div className=\"relative h-[300px] w-[300px]\">\n        {cards.map((card, index) => (\n          <Card key={card.id} updatePosition={() => updatePosition(card.id)}>\n            <motion.div\n              style={{\n                borderRadius: '32px',\n                transformOrigin: '0% 100%',\n              }}\n              animate={{\n                rotateZ: -(cards.length - index - 1) * 10,\n                scale: 1 + index * 0.1 - cards.length * 0.1,\n              }}\n              initial={false}\n              transition={{ type: 'spring', bounce: 0.1, duration: 0.5 }}\n              className=\"border-border bg-card text-card-foreground flex size-full flex-col overflow-hidden rounded-[32px] border p-2 shadow-[0px_0px_0px_1px_hsl(var(--border)/0.5),0px_1px_2px_-1px_hsl(var(--foreground)/0.08),0px_2px_4px_0px_hsl(var(--foreground)/0.06)]\"\n            >\n              <div className=\"pointer-events-none box-border flex h-full flex-1 flex-col p-4 select-none\">\n                <p className=\"text-muted-foreground text-lg font-normal tracking-wide\">\n                  {card.label}\n                </p>\n\n                <p\n                  className=\"text-2xl leading-tight font-bold\"\n                  style={{ color: card.accentColor }}\n                >\n                  {card.date}\n                </p>\n\n                <p className=\"text-foreground text-xl font-semibold\">\n                  {card.amount}\n                </p>\n\n                <div className=\"flex-1\" />\n\n                <div\n                  className=\"pointer-events-auto\"\n                  onClick={(e) => e.stopPropagation()}\n                />\n              </div>\n\n              <button className=\"bg-primary text-primary-foreground w-full cursor-pointer rounded-full border-none py-4 text-base font-semibold tracking-wide\">\n                Pay Now\n              </button>\n            </motion.div>\n          </Card>\n        ))}\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}
