{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"welcome-cards-whats-new","type":"registry:component","title":"Welcome cards · What’s new","description":"Swipeable release carousel with drawn art; a Pro feature turns the button into an ember upgrade.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/geturui/examples/welcome-cards/whats-new.tsx","type":"registry:component","target":"components/examples/welcome-cards/whats-new.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { ArrowRight, ChevronLeft, ChevronRight, Sparkles, X } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface WhatsNewSlide {\n  title: string;\n  body: string;\n  art?: \"branches\" | \"search\" | \"audit\";\n  /** Marks the feature as Pro; its button becomes an upgrade. */\n  pro?: boolean;\n}\n\nexport interface WhatsNewCardProps {\n  version?: string;\n  slides?: WhatsNewSlide[];\n  onTry?: (slide: WhatsNewSlide) => void;\n  onUpgrade?: () => void;\n  onDismiss?: () => void;\n  className?: string;\n}\n\nconst DEFAULT_SLIDES: WhatsNewSlide[] = [\n  { title: \"Branches for docs\", body: \"Draft big changes on a branch, get a review, and merge when it reads right.\", art: \"branches\" },\n  { title: \"Search that reads your mind\", body: \"Fuzzy matching across tasks, docs and comments. Press / anywhere to start.\", art: \"search\" },\n  { title: \"Audit log with export\", body: \"Every permission change and sign-in, filterable and exportable to CSV.\", art: \"audit\", pro: true },\n];\n\nconst focus = \"outline-none focus-visible:shadow-[var(--focus-ring)]\";\n\nfunction Art({ kind }: { kind: WhatsNewSlide[\"art\"] }) {\n  return (\n    <svg viewBox=\"0 0 320 120\" className=\"size-full\" aria-hidden>\n      <rect width=\"320\" height=\"120\" className=\"fill-surface-sunken\" />\n      {kind === \"search\" ? (\n        <g>\n          <rect x=\"50\" y=\"26\" width=\"220\" height=\"30\" rx=\"10\" className=\"fill-surface-raised stroke-border\" />\n          <circle cx=\"68\" cy=\"41\" r=\"5\" fill=\"none\" strokeWidth=\"2\" className=\"stroke-ink-subtle\" />\n          <rect x=\"82\" y=\"38\" width=\"70\" height=\"6\" rx=\"3\" className=\"fill-ink/70\" />\n          <rect x=\"50\" y=\"64\" width=\"220\" height=\"38\" rx=\"10\" className=\"fill-surface-raised stroke-border\" />\n          <rect x=\"62\" y=\"74\" width=\"8\" height=\"8\" rx=\"2\" className=\"fill-volt\" />\n          <rect x=\"78\" y=\"76\" width=\"110\" height=\"5\" rx=\"2.5\" className=\"fill-ink/50\" />\n          <rect x=\"62\" y=\"88\" width=\"8\" height=\"8\" rx=\"2\" className=\"fill-ink-subtle/40\" />\n          <rect x=\"78\" y=\"90\" width=\"80\" height=\"5\" rx=\"2.5\" className=\"fill-ink/25\" />\n        </g>\n      ) : kind === \"audit\" ? (\n        <g>\n          {[0, 1, 2, 3].map((r) => (\n            <g key={r} transform={`translate(40 ${20 + r * 22})`}>\n              <rect width=\"240\" height=\"16\" rx=\"5\" className={r === 1 ? \"fill-ember-soft\" : \"fill-surface-raised\"} />\n              <circle cx=\"12\" cy=\"8\" r=\"4\" className={r === 1 ? \"fill-ember\" : \"fill-ink-subtle/50\"} />\n              <rect x=\"24\" y=\"5.5\" width={90 - r * 10} height=\"5\" rx=\"2.5\" className=\"fill-ink/40\" />\n              <rect x=\"190\" y=\"5.5\" width=\"38\" height=\"5\" rx=\"2.5\" className=\"fill-ink/20\" />\n            </g>\n          ))}\n        </g>\n      ) : (\n        <g fill=\"none\" strokeWidth=\"2.5\" strokeLinecap=\"round\">\n          <path d=\"M30 70h260\" className=\"stroke-ink/30\" />\n          <path d=\"M90 70c20 0 20-34 46-34h70c26 0 26 34 46 34\" className=\"stroke-volt-ink\" />\n          {[30, 90, 290].map((x) => (\n            <circle key={x} cx={x} cy=\"70\" r=\"7\" className=\"fill-surface-raised stroke-ink/40\" />\n          ))}\n          {[150, 200].map((x) => (\n            <circle key={x} cx={x} cy=\"36\" r=\"7\" className=\"fill-volt stroke-volt-ink\" />\n          ))}\n          <circle cx=\"252\" cy=\"70\" r=\"7\" className=\"fill-surface-raised stroke-volt-ink\" />\n        </g>\n      )}\n    </svg>\n  );\n}\n\n/** Release card: swipe or step through what shipped, with drawn art per feature and a Pro feature that turns the button into an upgrade. */\nexport function WhatsNewCard({ version = \"Version 4.2 · Oct 2\", slides = DEFAULT_SLIDES, onTry, onUpgrade, onDismiss, className }: WhatsNewCardProps) {\n  const reduce = useReducedMotion() ?? false;\n  const [[i, dir], setPage] = React.useState<[number, number]>([0, 1]);\n  const slide = slides[i];\n  const last = i === slides.length - 1;\n\n  function go(d: number) {\n    const n = i + d;\n    if (n < 0 || n >= slides.length) return;\n    setPage([n, d]);\n  }\n\n  const fade = (key: string, content: React.ReactNode, cls?: string) => (\n    <motion.div\n      key={key}\n      initial={reduce ? { opacity: 0 } : { opacity: 0, x: dir * 28, filter: \"blur(6px)\" }}\n      animate={{ opacity: 1, x: 0, filter: \"blur(0px)\" }}\n      exit={reduce ? { opacity: 0 } : { opacity: 0, x: dir * -28, filter: \"blur(6px)\" }}\n      transition={{ type: \"spring\", stiffness: 320, damping: 32 }}\n      className={cls}\n    >\n      {content}\n    </motion.div>\n  );\n\n  return (\n    <section\n      aria-roledescription=\"carousel\"\n      aria-label=\"What’s new\"\n      onKeyDown={(e) => {\n        if (e.key === \"ArrowRight\") go(1);\n        if (e.key === \"ArrowLeft\") go(-1);\n      }}\n      className={cn(\"w-full max-w-[400px] overflow-hidden rounded-xl border border-border bg-surface-raised shadow-sm\", className)}\n    >\n      <div className=\"flex items-center justify-between px-5 pt-4\">\n        <span className=\"inline-flex items-center gap-1.5 text-[12px] font-semibold text-ink\">\n          <Sparkles aria-hidden className=\"size-3.5 text-volt-ink\" />\n          What’s new\n          <span className=\"font-normal text-ink-subtle\">· {version}</span>\n        </span>\n        <button type=\"button\" aria-label=\"Dismiss\" onClick={onDismiss} className={cn(\"grid size-7 place-items-center rounded-full text-ink-subtle hover:bg-surface-hover hover:text-ink\", focus)}>\n          <X aria-hidden className=\"size-4\" />\n        </button>\n      </div>\n\n      <motion.div\n        drag={reduce ? false : \"x\"}\n        dragConstraints={{ left: 0, right: 0 }}\n        dragElastic={0.18}\n        onDragEnd={(_, info) => {\n          if (info.offset.x < -50) go(1);\n          else if (info.offset.x > 50) go(-1);\n        }}\n        className=\"mx-5 mt-3 h-[120px] cursor-grab overflow-hidden rounded-lg border border-border active:cursor-grabbing\"\n      >\n        <AnimatePresence mode=\"popLayout\" initial={false}>\n          {fade(`art-${i}`, <Art kind={slide.art} />, \"size-full\")}\n        </AnimatePresence>\n      </motion.div>\n\n      <div className=\"relative h-[92px] overflow-hidden px-5 pt-4\" aria-live=\"polite\">\n        <AnimatePresence mode=\"popLayout\" initial={false}>\n          {fade(\n            `t-${i}`,\n            <>\n              <h3 className=\"flex items-center gap-2 text-[15px] font-semibold text-ink\">\n                {slide.title}\n                {slide.pro && <span className=\"rounded-full bg-ember-soft px-2 py-0.5 text-[10.5px] font-semibold text-ember-ink\">Pro</span>}\n              </h3>\n              <p className=\"mt-1 text-[13px] leading-relaxed text-ink-muted\">{slide.body}</p>\n            </>,\n          )}\n        </AnimatePresence>\n      </div>\n\n      <div className=\"flex items-center justify-between gap-3 border-t border-border px-5 py-3.5\">\n        <div className=\"flex items-center gap-1\">\n          <button type=\"button\" aria-label=\"Previous update\" disabled={i === 0} onClick={() => go(-1)} className={cn(\"grid size-8 place-items-center rounded-full text-ink-muted hover:bg-surface-hover disabled:opacity-30\", focus)}>\n            <ChevronLeft aria-hidden className=\"size-4\" />\n          </button>\n          <div className=\"flex gap-1.5\" aria-label={`Update ${i + 1} of ${slides.length}`} role=\"img\">\n            {slides.map((_, k) => (\n              <motion.span key={k} animate={{ width: k === i ? 16 : 6 }} transition={{ type: \"spring\", stiffness: 420, damping: 30 }} className={cn(\"h-1.5 rounded-full\", k === i ? \"bg-ink\" : \"bg-ink-subtle/35\")} />\n            ))}\n          </div>\n          <button type=\"button\" aria-label=\"Next update\" disabled={last} onClick={() => go(1)} className={cn(\"grid size-8 place-items-center rounded-full text-ink-muted hover:bg-surface-hover disabled:opacity-30\", focus)}>\n            <ChevronRight aria-hidden className=\"size-4\" />\n          </button>\n        </div>\n        <AnimatePresence mode=\"popLayout\" initial={false}>\n          <motion.button\n            key={slide.pro ? \"pro\" : \"try\"}\n            type=\"button\"\n            initial={{ opacity: 0, scale: 0.9, filter: \"blur(4px)\" }}\n            animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n            exit={{ opacity: 0, scale: 0.9, filter: \"blur(4px)\" }}\n            whileTap={reduce ? undefined : { scale: 0.96 }}\n            onClick={() => (slide.pro ? onUpgrade?.() : onTry?.(slide))}\n            className={cn(\"inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-[13px] font-semibold\", slide.pro ? \"bg-ember text-on-ember\" : \"bg-volt text-on-volt\", focus)}\n          >\n            {slide.pro ? \"Upgrade to Pro\" : \"Try it now\"}\n            <ArrowRight aria-hidden className=\"size-3.5\" />\n          </motion.button>\n        </AnimatePresence>\n      </div>\n    </section>\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","welcome","dashboard","onboarding","checklist","greeting","changelog","announcement","upgrade"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/welcome-cards#whats-new"}}