{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "preview-details-card-shadcnui", "type": "registry:ui", "title": "Preview Details Card", "description": "Link card that reveals a smooth detail preview box on hover", "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/micro/links/preview-details-card.tsx", "content": "\"use client\";\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n type Transition,\n type Variants,\n} from \"framer-motion\";\nimport { ArrowUpRight, Sparkles } from \"lucide-react\";\nimport { useId, useMemo, useState } from \"react\";\n\nconst previewHighlights = [\n { label: \"Owner\", value: \"Avery Nolan\" },\n { label: \"Status\", value: \"Sprint ready\" },\n { label: \"Last update\", value: \"4 hours ago\" },\n];\n\nexport function PreviewDetailsCard() {\n const [isActive, setIsActive] = useState(false);\n const previewId = useId();\n const descriptionId = useMemo(() => `${previewId}-description`, [previewId]);\n const shouldReduceMotion = useReducedMotion();\n\n const handleActivate = () => setIsActive(true);\n const handleDeactivate = () => setIsActive(false);\n\n const flyoutVariants: Variants = useMemo(\n () => ({\n hidden: {\n opacity: 0,\n y: shouldReduceMotion ? 0 : 12,\n scale: shouldReduceMotion ? 1 : 0.96,\n },\n visible: {\n opacity: 1,\n y: 0,\n scale: 1,\n transition: shouldReduceMotion\n ? { duration: 0 }\n : { duration: 0.28, ease: [0.19, 1, 0.22, 1] },\n },\n exit: {\n opacity: 0,\n y: shouldReduceMotion ? 0 : 8,\n scale: shouldReduceMotion ? 1 : 0.95,\n transition: shouldReduceMotion\n ? { duration: 0 }\n : { duration: 0.2, ease: [0.4, 0, 0.2, 1] },\n },\n }),\n [shouldReduceMotion]\n );\n\n const hoverMotion = shouldReduceMotion ? undefined : { scale: 1.02, y: -2 };\n const hoverTransition = shouldReduceMotion\n ? { duration: 0 }\n : { type: \"spring\", stiffness: 420, damping: 34, mass: 0.7 };\n\n return (\n \n
\n event.preventDefault()}\n onMouseEnter={handleActivate}\n onMouseLeave={handleDeactivate}\n onFocus={handleActivate}\n onBlur={handleDeactivate}\n className=\"group relative inline-flex w-full flex-col gap-4 rounded-3xl border border-border/60 bg-card/80 px-7 py-6 text-[var(--muted-foreground)] backdrop-blur-2xl transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:border-border\"\n layout\n whileHover={hoverMotion}\n transition={hoverTransition as Transition}\n >\n
\n \n \n \n \n Workspace\n \n \n
\n\n
\n \n Preview Details Card\n \n \n Hover or focus to surface key workspace traits before diving into\n the full view.\n

\n
\n\n \n Focus or hover to reveal the workspace summary panel that lists\n owner, status, and freshness details.\n \n\n \n {isActive && (\n \n
\n Preview\n \n instant\n \n
\n
    \n {previewHighlights.map((item) => (\n \n \n {item.label}\n \n \n {item.value}\n \n \n ))}\n
\n \n )}\n
\n \n
\n \n );\n}\n", "type": "registry:ui", "target": "components/uitripled/preview-details-card-shadcnui.tsx" } ] }