{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "mission-bento",
  "type": "registry:ui",
  "title": "Mission Bento",
  "description": "A stats bento with a masked heading reveal, staggered tiles, count-up numbers and a self-drawing trend arrow.",
  "files": [
    {
      "path": "src/registry/ui/mission-bento.tsx",
      "type": "registry:ui",
      "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { animate, motion, useInView, useReducedMotion, type Variants } from \"motion/react\";\nimport { Atom, Braces, Component, Sparkles, Wind } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nconst EASE_OUT = [0.23, 1, 0.32, 1] as const;\n\nexport type MissionStat = {\n  /** Copy above the number. */\n  text: React.ReactNode;\n  value: number;\n  decimals?: number;\n  prefix?: string;\n  suffix?: string;\n  label: React.ReactNode;\n};\n\nexport type MissionBentoProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n  eyebrow?: React.ReactNode;\n  /** The quiet first line of the heading. */\n  lead?: React.ReactNode;\n  /** The bold second line of the heading. */\n  title?: React.ReactNode;\n  description?: React.ReactNode;\n  /** Small pill above the first stat, e.g. a row of logos and a caption. */\n  badge?: React.ReactNode;\n  /** Status pill under the second stat. */\n  status?: React.ReactNode;\n  stats?: [MissionStat, MissionStat];\n  highlight?: MissionStat;\n  /** Any CSS color for the eyebrow and status accents. */\n  accent?: string;\n  /** Section background. */\n  surface?: string;\n  /** Text color on the section and its small cards. */\n  foreground?: string;\n  /** Background of the small cards and the eyebrow pill. */\n  card?: string;\n  /** Background of the large highlight card. */\n  highlightSurface?: string;\n  /** Text color on the highlight card. */\n  highlightForeground?: string;\n  /** Color of the live status dot. */\n  statusColor?: string;\n};\n\nconst TOOLS = [\n  { name: \"React\", icon: Atom },\n  { name: \"TypeScript\", icon: Braces },\n  { name: \"Tailwind CSS\", icon: Wind },\n  { name: \"Motion\", icon: Sparkles },\n  { name: \"Radix UI\", icon: Component },\n];\n\nconst DEFAULT_STATS: [MissionStat, MissionStat] = [\n  {\n    text: \"Every component ships fully typed, with props you can read at a glance\",\n    value: 100,\n    suffix: \"%\",\n    label: \"TypeScript coverage\",\n  },\n  {\n    text: \"Animations tuned for the compositor: transform and opacity only\",\n    value: 60,\n    suffix: \"fps\",\n    label: \"Target frame rate\",\n  },\n];\n\nconst DEFAULT_HIGHLIGHT: MissionStat = {\n  text: \"Animated components, blocks and backgrounds, ready to drop into any React project\",\n  value: 90,\n  suffix: \"+\",\n  label: (\n    <>\n      Ready to install\n      <br />\n      with the shadcn CLI\n    </>\n  ),\n};\n\n// Tiles rise in one after another; reduced motion fades them without moving.\nconst tileVariants: Variants = {\n  hidden: (reduce: boolean) => ({ opacity: 0, transform: reduce ? \"none\" : \"translateY(12px)\" }),\n  shown: (reduce: boolean) => ({\n    opacity: 1,\n    transform: reduce ? \"none\" : \"translateY(0px)\",\n    transition: { duration: 0.5, ease: EASE_OUT },\n  }),\n};\n\nexport function MissionBento({\n  eyebrow = \"Mission\",\n  lead = \"Our focus is simple\",\n  title = \"Interfaces that move\",\n  description = \"Copy a component, own the source and ship something that feels alive.\",\n  badge = <ToolStack />,\n  status = \"Free to use\",\n  stats = DEFAULT_STATS,\n  highlight = DEFAULT_HIGHLIGHT,\n  accent = \"#0A6EFF\",\n  surface = \"#F4F4F3\",\n  foreground = \"#171717\",\n  card = \"rgb(255 255 255 / 0.7)\",\n  highlightSurface = \"#1C1C1C\",\n  highlightForeground = \"#FFFFFF\",\n  statusColor = \"#10B981\",\n  className,\n  style,\n  ...props\n}: MissionBentoProps) {\n  const ref = useRef<HTMLDivElement>(null);\n  const inView = useInView(ref, { once: true, amount: 0.3 });\n  const reduceMotion = !!useReducedMotion();\n  const tile = { variants: tileVariants, custom: reduceMotion };\n\n  return (\n    <section\n      data-slot=\"mission-bento\"\n      style={\n        {\n          \"--mission-accent\": accent,\n          \"--mission-surface\": surface,\n          \"--mission-fg\": foreground,\n          \"--mission-card\": card,\n          \"--mission-highlight\": highlightSurface,\n          \"--mission-highlight-fg\": highlightForeground,\n          \"--mission-status\": statusColor,\n          ...style,\n        } as React.CSSProperties\n      }\n      className={cn(\"@container w-full rounded-[2rem] bg-[var(--mission-surface)] px-6 py-10 text-[var(--mission-fg)] sm:px-10 sm:py-12\", className)}\n      {...props}\n    >\n      <div ref={ref} className=\"mx-auto max-w-5xl\">\n        <span className=\"inline-flex rounded-full border border-[var(--mission-fg)]/5 bg-[var(--mission-card)] px-3 py-1 text-[0.625rem] font-semibold tracking-wider text-[var(--mission-accent)] uppercase shadow-sm\">\n          {eyebrow}\n        </span>\n\n        <div className=\"mt-6 flex flex-col gap-6 @3xl:flex-row @3xl:items-end @3xl:justify-between\">\n          <h2 className=\"text-4xl leading-[1.05] font-medium tracking-[-0.04em] @3xl:text-5xl\">\n            <RevealLine show={inView} reduce={reduceMotion} className=\"text-[var(--mission-fg)]/40\">\n              {lead}\n            </RevealLine>\n            <RevealLine show={inView} reduce={reduceMotion} delay={0.08}>\n              {title}\n            </RevealLine>\n          </h2>\n          <p className=\"max-w-xs text-sm leading-relaxed text-[var(--mission-fg)]/60\">{description}</p>\n        </div>\n\n        {/* Container queries: the bento layout follows the component's width. In two columns\n            the small pills share a short first row, so they never stretch beside a tall stat. */}\n        <motion.div\n          initial=\"hidden\"\n          animate={inView ? \"shown\" : \"hidden\"}\n          variants={{ hidden: {}, shown: { transition: { staggerChildren: 0.06 } } }}\n          className=\"mt-10 grid grid-cols-1 gap-3 @2xl:grid-cols-2 @4xl:grid-cols-[1fr_1fr_1.25fr] @4xl:grid-rows-[3.75rem_minmax(10rem,1fr)_3.75rem]\"\n        >\n          <motion.div {...tile} className={cn(cardClass, \"flex min-h-14 items-center px-4 @2xl:col-start-1 @2xl:row-start-1\")}>\n            {badge}\n          </motion.div>\n\n          <motion.div {...tile} className={cn(cardClass, \"flex min-h-52 flex-col p-5 @2xl:col-start-1 @2xl:row-start-2 @4xl:row-span-2 @4xl:min-h-0\")}>\n            <StatBody stat={stats[0]} show={inView} reduce={reduceMotion} />\n          </motion.div>\n\n          <motion.div {...tile} className={cn(cardClass, \"flex min-h-52 flex-col p-5 @2xl:col-start-2 @2xl:row-start-2 @4xl:row-span-2 @4xl:row-start-1 @4xl:min-h-0\")}>\n            <StatBody stat={stats[1]} show={inView} reduce={reduceMotion} />\n          </motion.div>\n\n          <motion.div {...tile} className={cn(cardClass, \"flex min-h-14 items-center gap-2.5 px-4 text-[0.625rem] font-semibold tracking-wider uppercase @2xl:col-start-2 @2xl:row-start-1 @4xl:row-start-3\")}>\n            <span aria-hidden className=\"relative flex size-2.5\">\n              <span className=\"absolute inset-0 animate-ping rounded-full bg-[var(--mission-status)]/60 [animation-duration:2s] motion-reduce:hidden\" />\n              <span className=\"relative size-2.5 rounded-full bg-[var(--mission-status)]\" />\n            </span>\n            {status}\n          </motion.div>\n\n          <motion.div\n            {...tile}\n            className=\"relative isolate flex min-h-72 flex-col overflow-hidden rounded-2xl bg-[var(--mission-highlight)] p-6 text-[var(--mission-highlight-fg)] shadow-2xl shadow-black/25 @2xl:col-span-2 @2xl:row-start-3 @4xl:col-span-1 @4xl:col-start-3 @4xl:row-span-3 @4xl:row-start-1 @4xl:min-h-0\"\n          >\n            <TrendArrow show={inView} reduce={reduceMotion} />\n            <p className=\"max-w-xs text-sm leading-relaxed text-[var(--mission-highlight-fg)]/75\">{highlight.text}</p>\n            <div className=\"mt-auto flex items-end justify-between gap-4\">\n              <p className=\"text-6xl leading-none font-medium tracking-[-0.05em] @4xl:text-7xl\">\n                <CountUp stat={highlight} show={inView} reduce={reduceMotion} />\n              </p>\n              <p className=\"pb-1 text-[0.625rem] leading-snug font-semibold tracking-wider text-[var(--mission-highlight-fg)]/70 uppercase\">\n                {highlight.label}\n              </p>\n            </div>\n          </motion.div>\n        </motion.div>\n      </div>\n    </section>\n  );\n}\n\nconst cardClass = \"rounded-2xl border border-[var(--mission-fg)]/5 bg-[var(--mission-card)] shadow-[0_1px_2px_rgb(0_0_0/0.04)]\";\n\n// A heading line that rises from behind its own mask.\nfunction RevealLine({\n  children,\n  show,\n  reduce,\n  delay = 0,\n  className,\n}: {\n  children: React.ReactNode;\n  show: boolean;\n  reduce: boolean;\n  delay?: number;\n  className?: string;\n}) {\n  return (\n    <span className={cn(\"block overflow-hidden pb-[0.08em]\", className)}>\n      <motion.span\n        className=\"block\"\n        initial={false}\n        animate={\n          reduce || show\n            ? { transform: \"translateY(0%)\", opacity: 1 }\n            : { transform: \"translateY(105%)\", opacity: 0 }\n        }\n        transition={{ duration: 0.7, ease: EASE_OUT, delay }}\n      >\n        {children}\n      </motion.span>\n    </span>\n  );\n}\n\nfunction StatBody({ stat, show, reduce }: { stat: MissionStat; show: boolean; reduce: boolean }) {\n  return (\n    <>\n      <p className=\"max-w-[16rem] text-sm leading-relaxed\">{stat.text}</p>\n      <p className=\"mt-auto pt-6 text-6xl leading-none font-medium tracking-[-0.05em] @4xl:text-7xl\">\n        <CountUp stat={stat} show={show} reduce={reduce} />\n      </p>\n      <p className=\"mt-2 text-sm text-[var(--mission-fg)]/60\">{stat.label}</p>\n    </>\n  );\n}\n\n// Counts from zero once in view, writing to the DOM so it never re-renders React.\n// The server renders the final value, so it reads correctly without JavaScript.\nfunction CountUp({ stat, show, reduce }: { stat: MissionStat; show: boolean; reduce: boolean }) {\n  const numberRef = useRef<HTMLSpanElement>(null);\n  const { value, decimals = 0, prefix = \"\", suffix = \"\" } = stat;\n\n  useEffect(() => {\n    const node = numberRef.current;\n    if (!show || reduce || !node) return;\n    const controls = animate(0, value, {\n      duration: 1.4,\n      ease: EASE_OUT,\n      onUpdate: (latest) => {\n        node.textContent = latest.toFixed(decimals);\n      },\n    });\n    return () => controls.stop();\n  }, [show, reduce, value, decimals]);\n\n  return (\n    <>\n      {prefix}\n      <span ref={numberRef} className=\"tabular-nums\">\n        {value.toFixed(decimals)}\n      </span>\n      {suffix && <span className=\"ml-1 align-baseline text-[0.45em] font-normal text-current/60\">{suffix}</span>}\n    </>\n  );\n}\n\n// A rising line with an arrowhead that draws itself in behind the dark tile's content.\nfunction TrendArrow({ show, reduce }: { show: boolean; reduce: boolean }) {\n  const drawn = reduce || show;\n  return (\n    <svg\n      aria-hidden\n      viewBox=\"0 0 320 220\"\n      className=\"absolute right-0 bottom-10 -z-10 h-[65%] w-auto max-w-[85%] text-[var(--mission-highlight-fg)]/[0.07]\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={22}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <motion.path\n        d=\"M10 200 L110 120 L160 160 L290 40\"\n        initial={false}\n        animate={{ pathLength: drawn ? 1 : 0 }}\n        transition={{ duration: reduce ? 0 : 1.2, ease: EASE_OUT, delay: 0.3 }}\n      />\n      <motion.path\n        d=\"M225 40 H290 V105\"\n        initial={false}\n        animate={{ pathLength: drawn ? 1 : 0, opacity: drawn ? 1 : 0 }}\n        transition={{ duration: reduce ? 0 : 0.5, ease: EASE_OUT, delay: reduce ? 0 : 1.3 }}\n      />\n    </svg>\n  );\n}\n\n// Overlapping icons of the stack, popping in one after another.\nfunction ToolStack() {\n  return (\n    <div className=\"flex w-full items-center justify-between gap-3\">\n      <motion.ul\n        aria-label=\"Built on\"\n        className=\"flex -space-x-2\"\n        variants={{ hidden: {}, shown: { transition: { staggerChildren: 0.06, delayChildren: 0.2 } } }}\n      >\n        {TOOLS.map(({ name, icon: Icon }) => (\n          <motion.li\n            key={name}\n            title={name}\n            variants={{\n              hidden: { opacity: 0, transform: \"scale(0.9)\" },\n              shown: { opacity: 1, transform: \"scale(1)\", transition: { duration: 0.3, ease: EASE_OUT } },\n            }}\n            className=\"flex size-8 items-center justify-center rounded-full bg-[var(--mission-fg)] text-[var(--mission-surface)] ring-2 ring-[var(--mission-card)]\"\n          >\n            <Icon aria-hidden className=\"size-3.5\" />\n            <span className=\"sr-only\">{name}</span>\n          </motion.li>\n        ))}\n      </motion.ul>\n      <p className=\"text-[0.625rem] font-semibold tracking-wider text-[var(--mission-fg)]/60 uppercase\">5 core tools</p>\n    </div>\n  );\n}\n"
    }
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ]
}
