{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "nonprofit-projects",
  "title": "Nonprofit: Projects band",
  "description": "A full-bleed band of the sea: a centred heading, a drawn map of the five invented areas, and the projects as a list where the chosen one opens with its funding line, summary and link, and lifts its pin.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://eased.dev/r/eased-tokens.json",
    "https://eased.dev/r/eased-motion.json",
    "https://eased.dev/r/nonprofit-core.json",
    "https://eased.dev/r/template-core.json"
  ],
  "files": [
    {
      "path": "src/registry/eased/templates/nonprofit/projects.tsx",
      "content": "\"use client\";\n\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { enter, exitFast, reducedFade, useSafeReducedMotion } from \"../../lib/motion\";\nimport { BaseLink } from \"../_shared/base\";\nimport { ProjectMap } from \"./art\";\nimport { projects, projectsBand, type Project } from \"./content\";\nimport { COLUMN, LABEL, LINK, Reveal, SECTION } from \"./kit\";\n\n/** A project's progress as a whole percentage, rounded down so it never reads as done before it is. */\nexport const fundedOf = (p: Project) => Math.min(100, Math.floor((p.raised / p.target) * 100));\n\n/**\n * The projects, on a full-bleed band of the sea: a centred heading, then the drawn map of the\n * five invented areas beside the five projects as a list. One project is open at a time, with a\n * line over it filled to how far it is funded, its summary and a link to its page; the others\n * show their names. Choosing one (a click, a tap, focus, or a resting mouse after 120ms) opens it\n * and lifts its pin on the map, which is decoration: the list says it all.\n */\nexport function ProjectsBand() {\n  const [open, setOpen] = useState(projects[0].slug);\n  const reduced = useSafeReducedMotion();\n  const timer = useRef(0);\n  useEffect(() => () => window.clearTimeout(timer.current), []);\n  const choose = (slug: string, delay = 0) => {\n    window.clearTimeout(timer.current);\n    if (delay) timer.current = window.setTimeout(() => setOpen(slug), delay);\n    else setOpen(slug);\n  };\n  return (\n    <section aria-labelledby=\"projects-title\" data-nf-sea=\"\" className=\"bg-bg text-text\">\n      <div className={`${COLUMN} ${SECTION} flex flex-col gap-group`}>\n        <Reveal className=\"mx-auto flex max-w-2xl flex-col items-center gap-pad-sm text-center\">\n          <p className={LABEL}>{projectsBand.label}</p>\n          <h2 id=\"projects-title\" className=\"font-display text-[clamp(2.75rem,6vw,5rem)] leading-[1] font-semibold tracking-[-0.04em] text-balance\">\n            {projectsBand.title}\n          </h2>\n          <p className=\"text-ui-md text-pretty text-text-secondary sm:text-ui-lg\">{projectsBand.body}</p>\n        </Reveal>\n        <div className=\"grid gap-group lg:grid-cols-[7fr_5fr] lg:items-center lg:gap-group-lg\">\n          <Reveal>\n            <figure className=\"relative rounded-surface border border-line-subtle bg-surface-sunken p-pad-base sm:p-pad-md\">\n              <ProjectMap pins={projects.map((p) => ({ slug: p.slug, ...p.pin }))} active={open} className=\"w-full\" />\n              <figcaption className=\"sr-only\">{projectsBand.mapLabel}</figcaption>\n            </figure>\n          </Reveal>\n          <ul className=\"flex flex-col\" onPointerLeave={() => window.clearTimeout(timer.current)}>\n            {projects.map((p) => {\n              const on = p.slug === open;\n              return (\n                <li key={p.slug} className=\"relative border-t border-line-subtle pt-pad-sm pb-pad-xs\">\n                  {on && (\n                    <span aria-hidden className=\"absolute -top-px left-0 h-0.5 w-full origin-left bg-(--nf-sun)\" style={{ transform: `scaleX(${fundedOf(p) / 100})` }} />\n                  )}\n                  <button\n                    type=\"button\"\n                    aria-expanded={on}\n                    aria-controls={`project-${p.slug}`}\n                    onClick={() => choose(p.slug)}\n                    onFocus={() => choose(p.slug)}\n                    onPointerEnter={(e) => e.pointerType === \"mouse\" && choose(p.slug, 120)}\n                    className={`focus-ring flex min-h-11 w-full items-baseline justify-between gap-pad-base rounded-control-sm text-left transition-colors duration-(--eased-duration-fast) ease-standard ${\n                      on ? \"text-text\" : \"text-text-secondary hover-fine:text-text\"\n                    }`}\n                  >\n                    <span className=\"font-display text-display-xl font-semibold tracking-display\">{p.name}</span>\n                    <span className=\"shrink-0 text-ui-sm tabular-nums\">{projectsBand.funded(`${fundedOf(p)}%`)}</span>\n                  </button>\n                  <AnimatePresence initial={false}>\n                    {on && (\n                      <motion.div\n                        key={p.slug}\n                        id={`project-${p.slug}`}\n                        initial={{ opacity: 0 }}\n                        animate={{ opacity: 1, transition: reduced ? reducedFade : enter }}\n                        exit={{ opacity: 0, transition: exitFast }}\n                        className=\"flex flex-col items-start gap-pad-xs pb-pad-sm\"\n                      >\n                        <p className=\"text-ui-sm text-text-muted\">{p.area}</p>\n                        <p className=\"max-w-md text-ui-md text-pretty text-text-secondary\">{p.summary}</p>\n                        <BaseLink href={`/projects/${p.slug}`} className={`inline-flex min-h-11 items-center text-ui ${LINK}`}>\n                          {projectsBand.read(p.name)}\n                        </BaseLink>\n                      </motion.div>\n                    )}\n                  </AnimatePresence>\n                </li>\n              );\n            })}\n            <li className=\"border-t border-line-subtle pt-pad-sm\">\n              <BaseLink href={projectsBand.all.href} className={`inline-flex min-h-11 items-center text-ui-md ${LINK}`}>\n                {projectsBand.all.label}\n              </BaseLink>\n            </li>\n          </ul>\n        </div>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/eased/templates/nonprofit/projects.tsx"
    }
  ],
  "meta": {
    "template": "nonprofit",
    "kind": "template-section",
    "industries": [
      "health"
    ]
  },
  "type": "registry:block"
}