{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"blog-cards-author","type":"registry:component","title":"Blog cards · Author-led","description":"Byline-first card with a pull quote, a bookmark that pops and ticks its count, and a copy-link action.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/geturui/examples/blog-cards/author.tsx","type":"registry:component","target":"components/examples/blog-cards/author.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { Bookmark, Check, Link2, Quote } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AuthorBlogCardProps {\n  author?: string;\n  role?: string;\n  /** Initials for the avatar; derived from `author` when omitted. */\n  monogram?: string;\n  title?: string;\n  /** A line pulled from the post, shown large. */\n  quote?: string;\n  /** ISO date (YYYY-MM-DD). */\n  date?: string;\n  readingMinutes?: number;\n  href?: string;\n  /** Absolute URL copied by the share button. */\n  shareUrl?: string;\n  saves?: number;\n  /** Controlled bookmark state. */\n  saved?: boolean;\n  defaultSaved?: boolean;\n  onSavedChange?: (saved: boolean) => void;\n  className?: string;\n}\n\nconst initialsOf = (name: string) =>\n  name\n    .split(/\\s+/)\n    .map((p) => p[0])\n    .filter(Boolean)\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n\nconst spring = { type: \"spring\", stiffness: 420, damping: 30 } as const;\n\n/** Author-led card: byline first, a pull quote from the post, and a bookmark that pops and ticks its count with a copy-link action beside it. */\nexport function AuthorBlogCard({\n  author = \"Tomás Ferreira\",\n  role = \"Staff engineer, Payments\",\n  monogram,\n  title = \"We deleted half our loading spinners. Conversion went up.\",\n  quote = \"A spinner promises progress it can't show. A skeleton shows the shape of what's coming, and people wait for shapes.\",\n  date = \"2026-09-24\",\n  readingMinutes = 6,\n  href = \"#\",\n  shareUrl = \"https://geturui.com/journal/fewer-spinners\",\n  saves = 214,\n  saved,\n  defaultSaved = false,\n  onSavedChange,\n  className,\n}: AuthorBlogCardProps) {\n  const reduce = useReducedMotion() ?? false;\n  const [inner, setInner] = React.useState(defaultSaved);\n  const isSaved = saved ?? inner;\n  const count = saves + (isSaved ? 1 : 0) - (defaultSaved ? 1 : 0);\n  const [copied, setCopied] = React.useState(false);\n  const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n  const id = React.useId();\n\n  React.useEffect(() => () => {\n    if (timer.current) clearTimeout(timer.current);\n  }, []);\n\n  function toggleSave() {\n    const next = !isSaved;\n    if (saved === undefined) setInner(next);\n    onSavedChange?.(next);\n  }\n\n  async function copy() {\n    try {\n      await navigator.clipboard?.writeText(shareUrl);\n    } catch {\n      // Clipboard can be blocked; the confirmation still shows so the action feels complete.\n    }\n    setCopied(true);\n    if (timer.current) clearTimeout(timer.current);\n    timer.current = setTimeout(() => setCopied(false), 1800);\n  }\n\n  const date_ = new Date(`${date}T12:00:00Z`).toLocaleDateString(\"en-US\", { month: \"long\", day: \"numeric\", timeZone: \"UTC\" });\n  const iconBtn =\n    \"inline-flex h-9 items-center gap-1.5 rounded-full border border-border-strong px-3 text-[13px] font-medium text-ink outline-none transition-colors hover:bg-surface-hover focus-visible:shadow-[var(--focus-ring)]\";\n\n  return (\n    <article aria-labelledby={`${id}-t`} className={cn(\"w-full max-w-[400px] rounded-xl border border-border bg-surface-raised p-5 shadow-sm\", className)}>\n      <header className=\"flex items-center gap-3\">\n        <span aria-hidden className=\"grid size-11 shrink-0 place-items-center rounded-full bg-ink font-display text-[15px] font-semibold text-bg\">\n          {monogram ?? initialsOf(author)}\n        </span>\n        <div className=\"min-w-0\">\n          <p className=\"truncate text-[14px] font-semibold text-ink\">{author}</p>\n          <p className=\"truncate text-xs text-ink-subtle\">{role}</p>\n        </div>\n      </header>\n\n      <figure className=\"relative mt-5 rounded-lg bg-surface-sunken px-5 pb-5 pt-11\">\n        <Quote aria-hidden className=\"absolute left-5 top-4 size-5 fill-volt-ink/20 text-volt-ink\" />\n        <blockquote className=\"font-display text-[18px] font-medium leading-[1.35] tracking-[-0.3px] text-ink\">{quote}</blockquote>\n      </figure>\n\n      <h3 id={`${id}-t`} className=\"mt-4 text-[15px] font-semibold leading-snug text-ink\">\n        <a href={href} className=\"rounded-xs outline-none decoration-ink/30 underline-offset-4 hover:underline focus-visible:shadow-[var(--focus-ring)]\">\n          {title}\n        </a>\n      </h3>\n      <p className=\"mt-1 text-xs text-ink-subtle\">\n        <time dateTime={date}>{date_}</time> · {readingMinutes} min read\n      </p>\n\n      <div className=\"mt-4 flex items-center gap-2 border-t border-border pt-4\">\n        <motion.button\n          type=\"button\"\n          aria-pressed={isSaved}\n          aria-label={isSaved ? \"Remove from saved\" : \"Save for later\"}\n          onClick={toggleSave}\n          whileTap={reduce ? undefined : { scale: 0.94 }}\n          transition={spring}\n          className={cn(iconBtn, isSaved && \"border-transparent bg-ink text-bg hover:bg-ink\")}\n        >\n          <motion.span key={String(isSaved)} initial={reduce || !isSaved ? false : { scale: 0.4, rotate: -20 }} animate={{ scale: 1, rotate: 0 }} transition={{ type: \"spring\", stiffness: 520, damping: 14 }}>\n            <Bookmark aria-hidden className={cn(\"size-4\", isSaved && \"fill-current\")} />\n          </motion.span>\n          <span className=\"relative inline-flex overflow-hidden tabular-nums\">\n            <AnimatePresence mode=\"popLayout\" initial={false}>\n              <motion.span\n                key={count}\n                initial={reduce ? { opacity: 0 } : { y: isSaved ? 12 : -12, opacity: 0 }}\n                animate={{ y: 0, opacity: 1 }}\n                exit={reduce ? { opacity: 0 } : { y: isSaved ? -12 : 12, opacity: 0 }}\n                transition={spring}\n              >\n                {count.toLocaleString(\"en-US\")}\n              </motion.span>\n            </AnimatePresence>\n          </span>\n        </motion.button>\n\n        <motion.button type=\"button\" onClick={copy} whileTap={reduce ? undefined : { scale: 0.94 }} className={iconBtn}>\n          <AnimatePresence mode=\"popLayout\" initial={false}>\n            <motion.span\n              key={copied ? \"c\" : \"l\"}\n              initial={{ opacity: 0, filter: \"blur(6px)\", y: reduce ? 0 : 6 }}\n              animate={{ opacity: 1, filter: \"blur(0px)\", y: 0 }}\n              exit={{ opacity: 0, filter: \"blur(6px)\", y: reduce ? 0 : -6 }}\n              transition={{ duration: 0.18 }}\n              className=\"inline-flex items-center gap-1.5\"\n            >\n              {copied ? <Check aria-hidden className=\"size-4 text-volt-ink\" strokeWidth={2.5} /> : <Link2 aria-hidden className=\"size-4\" />}\n              {copied ? \"Copied\" : \"Copy link\"}\n            </motion.span>\n          </AnimatePresence>\n        </motion.button>\n        <span role=\"status\" className=\"sr-only\">\n          {copied ? \"Link copied\" : \"\"}\n        </span>\n      </div>\n    </article>\n  );\n}\n"},{"path":"LICENSE-geturui.md","type":"registry:file","target":"LICENSE-geturui.md","content":"MIT License\n\nCopyright (c) 2026 geturui.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"}],"categories":["examples","blog","article","post","card","journal","editorial","reading time","bookmark","series"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/blog-cards#author"}}