{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"announcement","type":"registry:ui","title":"Announcement","description":"Pill-shaped news link with a highlighted tag, a periodic shine sweep and a chevron that extends into an arrow on hover.","dependencies":[],"registryDependencies":["utils"],"files":[{"path":"registry/ui/announcement.tsx","type":"registry:ui","content":"\"use client\";\n\nimport type { AnchorHTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n// Shine: a skewed highlight crosses the pill, then rests for most of the cycle.\n// Arrow: the chevron slides right while its stem draws in (stroke-dashoffset).\nconst css = `\n@keyframes ui-ann-shine{0%,60%{translate:-100% 0}100%{translate:250% 0}}\n.ui-ann-shine::after{content:\"\";position:absolute;inset:0;width:40%;pointer-events:none;background:linear-gradient(100deg,transparent,color-mix(in oklab,var(--foreground) 14%,transparent) 50%,transparent);animation:ui-ann-shine 4s ease-in-out infinite}\n.ui-ann-arrow path{transition:translate .25s cubic-bezier(.3,1.4,.5,1),stroke-dashoffset .25s ease}\n.ui-ann-arrow .stem{stroke-dasharray:1;stroke-dashoffset:1}\n.group\\\\/ann:hover .ui-ann-arrow .stem,.group\\\\/ann:focus-visible .ui-ann-arrow .stem{stroke-dashoffset:0}\n.group\\\\/ann:hover .ui-ann-arrow .head,.group\\\\/ann:focus-visible .ui-ann-arrow .head{translate:3px 0}\n@media (prefers-reduced-motion:reduce){.ui-ann-shine::after{animation:none;opacity:0}.ui-ann-arrow path{transition:none}}\n`;\n\nexport interface AnnouncementProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n  /** Short highlighted chip before the text, e.g. \"New\". Omit for none. */\n  tag?: ReactNode;\n  /** Periodic light sweep across the pill. */\n  shine?: boolean;\n  /** Trailing arrow that extends on hover. */\n  arrow?: boolean;\n}\n\nexport function Announcement({\n  tag = \"New\",\n  shine = true,\n  arrow = true,\n  className,\n  children,\n  ...props\n}: AnnouncementProps) {\n  return (\n    <a\n      {...props}\n      className={cn(\n        \"group/ann relative inline-flex w-fit max-w-full items-center gap-2.5 overflow-hidden rounded-full border border-border bg-card/80 py-1 pr-3.5 pl-1 text-sm text-foreground shadow-sm backdrop-blur outline-none\",\n        \"transition-[border-color,box-shadow,scale] duration-200 hover:border-primary/40 hover:shadow-md hover:shadow-primary/10 focus-visible:ring-[3px] focus-visible:ring-ring/50 active:scale-[0.98]\",\n        !tag && \"pl-3.5\",\n        shine && \"ui-ann-shine\",\n        className,\n      )}\n    >\n      <style href=\"ui-announcement\" precedence=\"default\">\n        {css}\n      </style>\n      {tag && (\n        <span className=\"shrink-0 rounded-full bg-primary px-2 py-0.5 text-xs font-semibold text-primary-foreground\">{tag}</span>\n      )}\n      <span className=\"truncate\">{children}</span>\n      {arrow && (\n        <svg\n          aria-hidden\n          viewBox=\"0 0 16 16\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth={1.75}\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          className=\"ui-ann-arrow -ml-0.5 size-4 shrink-0 text-muted-foreground transition-colors group-hover/ann:text-foreground\"\n        >\n          <path className=\"stem\" pathLength={1} d=\"M3 8h9.5\" />\n          <path className=\"head\" d=\"M6.5 4.5 10 8l-3.5 3.5\" />\n        </svg>\n      )}\n    </a>\n  );\n}\n"}]}