{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "nonprofit-chain",
  "title": "Nonprofit: What a gift does",
  "description": "Four steps from a gift to a full glass as tiles, each with its drawing on the sea, the pipe running through all four, a line on what happens and one concrete detail; water runs along the pipe once on first sight.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://eased.dev/r/eased-tokens.json",
    "https://eased.dev/r/eased-motion.json",
    "https://eased.dev/r/nonprofit-core.json"
  ],
  "files": [
    {
      "path": "src/registry/eased/templates/nonprofit/chain.tsx",
      "content": "\"use client\";\n\nimport { motion, useInView } from \"motion/react\";\nimport { useRef } from \"react\";\nimport { ease, instant, useSafeReducedMotion } from \"../../lib/motion\";\nimport { Station } from \"./art\";\nimport { chain } from \"./content\";\nimport { COLUMN, LABEL, NOTE, Reveal, SECTION, TITLE } from \"./kit\";\n\n/** How long the water takes to cross one tile, in seconds. */\nconst LEG = 0.55;\n\n/**\n * What a gift does: the heading, then the four steps from a gift to a full glass as tiles in a\n * row. Each tile holds its drawing on the sea with the pipe running through it, then its number\n * and title, a line on what happens and one concrete detail. From lg the pipe carries on across\n * the gaps, so it runs through all four. The first time the row is in view, water runs along the\n * pipe tile by tile and each drawing comes up to full strength as it arrives. Under reduced\n * motion it is drawn full.\n */\nexport function Chain() {\n  const ref = useRef<HTMLOListElement>(null);\n  const seen = useInView(ref, { once: true, amount: 0.4 });\n  const reduced = useSafeReducedMotion();\n  const done = seen || reduced;\n  const run = (i: number, span = 1) => (reduced ? instant : { duration: LEG * span, ease: ease.inOut, delay: i * LEG });\n  return (\n    <section aria-labelledby=\"chain-title\" className={`${COLUMN} ${SECTION} flex flex-col gap-group`}>\n      <Reveal className=\"flex max-w-3xl flex-col items-start gap-pad-sm\">\n        <p className={`${LABEL} rounded-pill border border-line-subtle bg-surface px-3 py-1`}>{chain.label}</p>\n        <h2 id=\"chain-title\" className={TITLE}>\n          {chain.title}\n        </h2>\n      </Reveal>\n      <ol ref={ref} className=\"relative isolate grid gap-tiles-lg sm:grid-cols-2 lg:grid-cols-4\">\n        {/* The pipe across the gaps between tiles: the tiles paint over it. */}\n        <span aria-hidden className=\"absolute inset-x-0 top-[6.125rem] hidden h-3 overflow-hidden bg-(--nf-sea-deep) lg:block\">\n          <motion.span className=\"absolute inset-0 origin-left bg-(--nf-water)\" initial={false} animate={{ scaleX: done ? 1 : 0 }} transition={run(0, chain.steps.length)} />\n        </span>\n        {chain.steps.map((step, i) => (\n          <li key={step.id} className=\"relative flex flex-col gap-pad-sm\">\n            <div aria-hidden data-nf-sea=\"\" className=\"relative flex h-52 items-center justify-center overflow-hidden rounded-surface bg-bg\">\n              <span className=\"absolute inset-x-0 top-[6.125rem] h-3 overflow-hidden bg-(--nf-sea-deep)\">\n                <motion.span className=\"absolute inset-0 origin-left bg-(--nf-water)\" initial={false} animate={{ scaleX: done ? 1 : 0 }} transition={run(i)} />\n              </span>\n              <span className=\"absolute top-pad-sm left-pad-sm flex size-8 items-center justify-center rounded-full bg-surface-raised text-ui-sm font-semibold text-text tabular-nums\">\n                {i + 1}\n              </span>\n              <motion.span\n                className=\"relative block size-32\"\n                initial={false}\n                animate={{ opacity: done ? 1 : 0.4, scale: done ? 1 : 0.94 }}\n                transition={reduced ? instant : { duration: 0.3, ease: ease.enter, delay: (i + 0.6) * LEG }}\n              >\n                <Station id={step.id} className=\"size-full\" />\n              </motion.span>\n            </div>\n            <div className=\"flex flex-col gap-1.5 px-1\">\n              <h3 className=\"text-ui-lg font-semibold text-text\">\n                <span className=\"sr-only\">{i + 1}. </span>\n                {step.title}\n              </h3>\n              <p className=\"text-ui-md text-pretty text-text-secondary\">{step.body}</p>\n              <p className=\"mt-1 self-start rounded-pill bg-brand-subtle px-2.5 py-1 text-ui-sm font-medium text-brand-text\">{step.detail}</p>\n            </div>\n          </li>\n        ))}\n      </ol>\n      <p className={NOTE}>{chain.note}</p>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/eased/templates/nonprofit/chain.tsx"
    }
  ],
  "meta": {
    "template": "nonprofit",
    "kind": "template-section",
    "industries": [
      "health"
    ]
  },
  "type": "registry:block"
}