{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"welcome-cards-today","type":"registry:component","title":"Welcome cards · Today","description":"Time-aware greeting, today’s numbers counting up in a stagger and an up-next strip you can step through.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/geturui/examples/welcome-cards/today.tsx","type":"registry:component","target":"components/examples/welcome-cards/today.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, animate, motion, useReducedMotion } from \"motion/react\";\nimport { ChevronLeft, ChevronRight, Video } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface TodayStat {\n  label: string;\n  value: number;\n  /** Small caption under the number. */\n  hint?: string;\n}\n\nexport interface TodayEvent {\n  title: string;\n  /** Formatted time, e.g. \"10:30\". */\n  time: string;\n  /** Relative caption, e.g. \"in 25 min\". */\n  relative: string;\n  people: string[];\n}\n\nexport interface WelcomeTodayCardProps {\n  name?: string;\n  /** Local hour (0–23) used for the greeting; pass it in so render stays deterministic. */\n  hour?: number;\n  /** Formatted date, e.g. \"Friday, October 2\". */\n  dateLabel?: string;\n  stats?: TodayStat[];\n  events?: TodayEvent[];\n  onJoin?: (event: TodayEvent) => void;\n  className?: string;\n}\n\nconst focus = \"outline-none focus-visible:shadow-[var(--focus-ring)]\";\n\nfunction greeting(h: number) {\n  return h < 12 ? \"Good morning\" : h < 18 ? \"Good afternoon\" : \"Good evening\";\n}\n\nfunction CountUp({ to, delay, reduce }: { to: number; delay: number; reduce: boolean }) {\n  const ref = React.useRef<HTMLSpanElement>(null);\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el || reduce) return;\n    el.textContent = \"0\";\n    const c = animate(0, to, { duration: 0.9, delay, ease: [0.22, 1, 0.36, 1], onUpdate: (v) => (el.textContent = String(Math.round(v))) });\n    return () => c.stop();\n  }, [to, delay, reduce]);\n  return <span ref={ref}>{to}</span>;\n}\n\n/** Dashboard welcome: time-aware greeting, today’s numbers counting up in a stagger, and an up-next strip you can step through. */\nexport function WelcomeTodayCard({\n  name = \"Maya\",\n  hour = 9,\n  dateLabel = \"Friday, October 2\",\n  stats = [\n    { label: \"Meetings\", value: 4, hint: \"2h 15m total\" },\n    { label: \"Tasks due\", value: 6, hint: \"2 overdue\" },\n    { label: \"Unread\", value: 18, hint: \"3 mentions\" },\n  ],\n  events = [\n    { title: \"Design review: billing v2\", time: \"10:30\", relative: \"in 25 min\", people: [\"PR\", \"TH\", \"KM\"] },\n    { title: \"1:1 with Jordan\", time: \"13:00\", relative: \"in 3h 55m\", people: [\"JL\"] },\n    { title: \"Pricing sync\", time: \"16:00\", relative: \"in 6h 55m\", people: [\"AO\", \"LM\"] },\n  ],\n  onJoin,\n  className,\n}: WelcomeTodayCardProps) {\n  const reduce = useReducedMotion() ?? false;\n  const [i, setI] = React.useState(0);\n  const [dir, setDir] = React.useState(1);\n  const ev = events[i];\n\n  function go(d: number) {\n    setDir(d);\n    setI((n) => (n + d + events.length) % events.length);\n  }\n\n  return (\n    <section aria-label=\"Today\" className={cn(\"@container w-full max-w-[520px] rounded-xl border border-border bg-surface-raised p-5 shadow-sm\", className)}>\n      <motion.div initial={reduce ? false : { opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} transition={{ type: \"spring\", stiffness: 260, damping: 28 }}>\n        <p className=\"font-mono text-[11px] uppercase tracking-[0.12em] text-ink-subtle\">{dateLabel}</p>\n        <h2 className=\"mt-1.5 font-display text-[26px] font-semibold leading-tight tracking-[-0.6px] text-ink\">\n          {greeting(hour)}, {name}\n        </h2>\n        <p className=\"mt-1 text-sm text-ink-muted\">Here is what today looks like.</p>\n      </motion.div>\n\n      <dl className=\"mt-5 grid grid-cols-3 gap-2\">\n        {stats.map((s, k) => (\n          <motion.div\n            key={s.label}\n            initial={reduce ? false : { opacity: 0, y: 10 }}\n            animate={{ opacity: 1, y: 0 }}\n            transition={{ type: \"spring\", stiffness: 280, damping: 26, delay: reduce ? 0 : 0.12 + k * 0.08 }}\n            className=\"rounded-md bg-surface-sunken/70 px-3 py-3\"\n          >\n            <dt className=\"text-[11.5px] font-medium text-ink-muted\">{s.label}</dt>\n            <dd className=\"mt-1 font-display text-[26px] font-semibold leading-none tracking-[-0.6px] text-ink tabular-nums\">\n              <CountUp to={s.value} delay={0.15 + k * 0.08} reduce={reduce} />\n            </dd>\n            {s.hint && <dd className=\"mt-1 truncate text-[11px] text-ink-subtle\">{s.hint}</dd>}\n          </motion.div>\n        ))}\n      </dl>\n\n      {ev && (\n        <div className=\"mt-4 flex flex-wrap items-center gap-3 rounded-lg border border-border p-3\">\n          <div className=\"relative min-w-[200px] flex-1 overflow-hidden\" aria-live=\"polite\">\n            <AnimatePresence mode=\"popLayout\" initial={false} custom={dir}>\n              <motion.div\n                key={i}\n                custom={dir}\n                initial={reduce ? { opacity: 0 } : { opacity: 0, x: dir * 24, filter: \"blur(6px)\" }}\n                animate={{ opacity: 1, x: 0, filter: \"blur(0px)\" }}\n                exit={reduce ? { opacity: 0 } : { opacity: 0, x: dir * -24, filter: \"blur(6px)\" }}\n                transition={{ type: \"spring\", stiffness: 340, damping: 32 }}\n              >\n                <p className=\"text-[11px] font-medium text-ink-subtle\">\n                  Up next · <span className=\"text-ink\">{ev.time}</span> · {ev.relative}\n                </p>\n                <p className=\"mt-0.5 truncate text-[14px] font-semibold text-ink\">{ev.title}</p>\n                <div className=\"mt-1.5 flex\">\n                  {ev.people.map((p, k) => (\n                    <span key={p} aria-hidden className={cn(\"grid size-5 place-items-center rounded-full border-2 border-surface-raised bg-surface-sunken font-mono text-[8px] font-semibold text-ink\", k && \"-ml-1.5\")}>\n                      {p}\n                    </span>\n                  ))}\n                  <span className=\"sr-only\">{ev.people.length} attendees</span>\n                </div>\n              </motion.div>\n            </AnimatePresence>\n          </div>\n          <div className=\"ml-auto flex items-center gap-1.5\">\n            <button type=\"button\" aria-label=\"Previous event\" onClick={() => go(-1)} className={cn(\"grid size-8 place-items-center rounded-full text-ink-muted hover:bg-surface-hover hover:text-ink\", focus)}>\n              <ChevronLeft aria-hidden className=\"size-4\" />\n            </button>\n            <button type=\"button\" aria-label=\"Next event\" onClick={() => go(1)} className={cn(\"grid size-8 place-items-center rounded-full text-ink-muted hover:bg-surface-hover hover:text-ink\", focus)}>\n              <ChevronRight aria-hidden className=\"size-4\" />\n            </button>\n            <motion.button type=\"button\" whileTap={reduce ? undefined : { scale: 0.96 }} onClick={() => onJoin?.(ev)} className={cn(\"inline-flex h-9 items-center gap-1.5 rounded-full bg-volt px-4 text-[13px] font-semibold text-on-volt\", focus)}>\n              <Video aria-hidden className=\"size-4\" />\n              Join\n            </motion.button>\n          </div>\n        </div>\n      )}\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#today"}}