{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"newsletter-signup","type":"registry:block","title":"Newsletter signup","description":"An email signup framed by a stack of past issues; subscribing drops the next issue, addressed to you, onto the front.","categories":["blocks"],"dependencies":["lucide-react","motion"],"registryDependencies":["https://uiarc.dev/r/arc-motion-tokens.json","https://uiarc.dev/r/animated-counter.json","https://uiarc.dev/r/segmented-control.json","https://uiarc.dev/r/switch.json"],"files":[{"path":"registry/blocks/newsletter-signup/newsletter-signup.tsx","type":"registry:component","target":"@components/arc/blocks/newsletter-signup/newsletter-signup.tsx","content":"\"use client\";\n\nimport { forwardRef, useEffect, useId, useRef, useState } from \"react\";\nimport type { FormEvent, ReactNode } from \"react\";\nimport Image from \"next/image\";\nimport { AnimatePresence, motion, useAnimate, useReducedMotion } from \"motion/react\";\nimport type { Variants } from \"motion/react\";\nimport { ArrowRight } from \"lucide-react\";\nimport AnimatedCounter from \"../../animated-counter/animated-counter\";\nimport SegmentedControl from \"../../segmented-control/segmented-control\";\nimport { Switch } from \"../../switch/switch\";\nimport { motionTokens } from \"../../lib/motion-tokens\";\nimport { newsletterCopy, newsletterPublication, newsletterReaders } from \"./newsletter-signup-data\";\nimport type { NewsletterIssue, NewsletterPublication } from \"./newsletter-signup-data\";\nimport styles from \"./newsletter-signup.module.css\";\n\nexport type { NewsletterIssue, NewsletterPublication, NewsletterStory } from \"./newsletter-signup-data\";\nexport type NewsletterVariant = \"inline\" | \"card\";\n\nexport interface NewsletterSignupProps {\n  /** `inline` puts the copy and form beside the issue stack; `card` is a self-contained card with the stack in a tray on top. */\n  variant?: NewsletterVariant;\n  title?: string;\n  description?: string;\n  placeholder?: string;\n  buttonLabel?: string;\n  /** Short line under the form about frequency and privacy. */\n  privacyNote?: ReactNode;\n  /** Link after the privacy note. Pass null to hide it. */\n  privacyLink?: { label: string; href: string } | null;\n  /** Reader count and up to three faces. The count ticks up by one when someone subscribes. Pass null to hide it. */\n  readers?: { count: number; faces: string[] } | null;\n  /** The issue stack. On success the upcoming issue, addressed to the new reader, lands on top. Pass null for a form without the stack. */\n  publication?: NewsletterPublication | null;\n  /** Called with a valid, trimmed email. Reject to show an error and keep the email; resolve to show the success state. */\n  onSubscribe?: (email: string) => void | Promise<void>;\n  className?: string;\n}\n\ntype Phase = \"idle\" | \"sending\" | \"done\";\ntype Problem = { kind: \"invalid\" | \"failed\"; text: string };\ntype Bezier = [number, number, number, number];\nconst enter = [...motionTokens.ease.enter] as Bezier;\nconst standard = [...motionTokens.ease.standard] as Bezier;\nconst MESSAGES = {\n  empty: \"Enter your email address\",\n  format: \"Enter an email like name@company.com\",\n  failed: \"That didn't go through. Your email is kept, so try again.\",\n};\nconst EMAIL = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;\n/** How far each issue behind the front one peeks out above it. */\nconst STEP = 12;\n\nfunction validate(value: string): Problem | null {\n  const email = value.trim();\n  if (!email) return { kind: \"invalid\", text: MESSAGES.empty };\n  if (!EMAIL.test(email)) return { kind: \"invalid\", text: MESSAGES.format };\n  return null;\n}\n\nconst swapIn = { opacity: 0, y: 6, filter: `blur(${motionTokens.blur.subtle}px)` };\nconst swapShown = { opacity: 1, y: 0, filter: \"blur(0px)\" };\nconst swapOut = { opacity: 0, y: -6, filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: motionTokens.duration.fast, ease: standard } };\nconst fadeIn = { opacity: 0 };\nconst fadeOut = { opacity: 0, transition: { duration: motionTokens.duration.instant } };\n\n/** A line that swaps in place: the old text lifts away and the new one rises out of a soft blur. */\nfunction Swap({ id, children, reduced, className, live }: { id: string; children: ReactNode; reduced: boolean; className?: string; live?: \"polite\" }) {\n  return <div className={className} aria-live={live}>\n    <AnimatePresence initial={false} mode=\"popLayout\">\n      <motion.div key={id} initial={reduced ? fadeIn : swapIn} animate={swapShown} exit={reduced ? fadeOut : swapOut} transition={{ duration: reduced ? motionTokens.duration.instant : motionTokens.duration.standard, ease: enter }}>{children}</motion.div>\n    </AnimatePresence>\n  </div>;\n}\n\n/** One issue: masthead, recipient line, subject, and three stories with thumbnails. */\nfunction IssueCard({ issue, name, to }: { issue: NewsletterIssue; name: string; to?: string }) {\n  return <>\n    <header className={styles.issueHead}>\n      <span className={styles.masthead}>{name}</span>\n      <span className={styles.issueNumber}>Issue {issue.number}</span>\n    </header>\n    <p className={styles.issueMeta}>\n      <span className={styles.issueDate}>{issue.date}</span>\n      {to && <><span aria-hidden=\"true\">&middot;</span><span className={styles.recipient}>To <span className={styles.recipientEmail}>{to}</span></span></>}\n    </p>\n    <h3 className={styles.subject}>{issue.subject}</h3>\n    <ul className={styles.stories}>\n      {issue.stories.slice(0, 3).map(story => <li key={story.title} className={styles.story}>\n        <Image className={styles.thumb} src={story.image} alt=\"\" width={88} height={88} sizes=\"44px\" />\n        <span className={styles.storyTitle}>{story.title}</span>\n        <span className={styles.minutes}>{story.minutes} min</span>\n      </li>)}\n    </ul>\n  </>;\n}\n\ntype Placement = { depth: number; upcoming: boolean };\n/** The front issue sits flat; each one behind steps up and shrinks a little so its top edge shows. */\nconst stackVariants: Variants = {\n  placed: ({ depth }: Placement) => ({ opacity: 1, y: -depth * STEP, scale: 1 - depth * .045 }),\n  // The upcoming issue arrives from below, where the form is; older ones slide in from behind.\n  away: ({ upcoming }: Placement) => upcoming ? { opacity: 0, y: 56, scale: 1 } : { opacity: 0, y: -3 * STEP, scale: 1 - 3 * .045 },\n};\n/** Position rides the no-overshoot spring; opacity resolves fast so two issues never read through each other. */\nconst settle = { ...motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.instant, ease: standard } };\n/** Reduced motion: issues take their places at once and only fade. */\nconst still = { duration: 0, opacity: { duration: motionTokens.duration.fast } };\n\n/**\n * A stack of recent issues. When someone subscribes, the upcoming issue, addressed to them, lands on the front\n * and the older ones step back; the oldest drops away.\n */\nfunction IssueStack({ publication, delivered, to, reduced, compact }: { publication: NewsletterPublication; delivered: boolean; to: string; reduced: boolean; compact?: boolean }) {\n  const issues = (delivered ? [publication.upcoming, ...publication.recent] : publication.recent).slice(0, 3);\n  return <div className={styles.stack} data-compact={compact ? \"\" : undefined}>\n    {/* An unseen copy of the upcoming issue keeps the stack as tall as the tallest issue it will ever hold. */}\n    <div className={`${styles.issue} ${styles.issueSizer}`} aria-hidden=\"true\"><IssueCard issue={publication.upcoming} name={publication.name} to={to || \" \"} /></div>\n    <AnimatePresence initial={false}>\n      {issues.map((issue, depth) => {\n        const upcoming = issue === publication.upcoming;\n        const placement: Placement = { depth, upcoming };\n        return <motion.article\n          key={issue.number}\n          className={styles.issue}\n          data-depth={depth}\n          aria-hidden={depth > 0 ? true : undefined}\n          aria-label={depth === 0 ? `${publication.name}, issue ${issue.number}` : undefined}\n          custom={placement}\n          variants={stackVariants}\n          initial=\"away\"\n          animate=\"placed\"\n          exit=\"away\"\n          transition={reduced ? still : settle}\n          style={{ zIndex: 3 - depth }}\n        >\n          <IssueCard issue={issue} name={publication.name} to={upcoming ? to : undefined} />\n        </motion.article>;\n      })}\n    </AnimatePresence>\n  </div>;\n}\n\n/** Faces and a reader count that ticks up by one when you join. */\nfunction Readers({ readers, done, reduced }: { readers: { count: number; faces: string[] }; done: boolean; reduced: boolean }) {\n  return <div className={styles.readers}>\n    <span className={styles.faces} aria-hidden=\"true\">\n      {readers.faces.slice(0, 3).map(src => <Image key={src} src={src} alt=\"\" width={56} height={56} sizes=\"28px\" />)}\n    </span>\n    <span className={styles.readerLine}>\n      <span className={styles.count}><AnimatedCounter value={readers.count + (done ? 1 : 0)} /></span>\n      {\" \"}readers\n      <AnimatePresence initial={false}>\n        {/* The phrase opens its own width on the no-overshoot spring, so the centred line glides instead of jumping sideways. */}\n        {done && <motion.span key=\"you\" className={styles.you}\n          initial={reduced ? { opacity: 0 } : { opacity: 0, width: 0 }}\n          animate={reduced ? { opacity: 1 } : { opacity: 1, width: \"auto\" }}\n          exit={reduced ? { opacity: 0 } : { opacity: 0, width: 0 }}\n          transition={reduced ? { duration: motionTokens.duration.instant } : { width: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.standard, ease: enter, delay: .12 } }}>, including you</motion.span>}\n      </AnimatePresence>\n    </span>\n  </div>;\n}\n\n/**\n * A newsletter signup framed by the newsletter itself: a stack of recent issues. Subscribing drops the next issue,\n * addressed to the new reader, onto the front of the stack and ticks the reader count up by one.\n * Comes as an inline page section or a self-contained card.\n */\nexport const NewsletterSignup = forwardRef<HTMLElement, NewsletterSignupProps>(function NewsletterSignup({\n  variant = \"inline\",\n  title,\n  description,\n  placeholder = \"you@company.com\",\n  buttonLabel = \"Subscribe\",\n  privacyNote = newsletterCopy.privacy,\n  privacyLink = newsletterCopy.privacyLink,\n  readers = newsletterReaders,\n  publication = newsletterPublication,\n  onSubscribe,\n  className,\n}, ref) {\n  const id = useId();\n  const reduced = !!useReducedMotion();\n  const [email, setEmail] = useState(\"\");\n  const [problem, setProblem] = useState<Problem | null>(null);\n  const [tried, setTried] = useState(false);\n  const [phase, setPhase] = useState<Phase>(\"idle\");\n  const [sentTo, setSentTo] = useState(\"\");\n  const input = useRef<HTMLInputElement>(null);\n  const again = useRef<HTMLButtonElement>(null);\n  const busy = useRef(false);\n  const refocus = useRef(false);\n  const [pill, animatePill] = useAnimate<HTMLDivElement>();\n  const copy = newsletterCopy[variant];\n\n  useEffect(() => {\n    if (phase === \"idle\" && refocus.current) { refocus.current = false; input.current?.focus(); }\n    if (phase === \"done\") again.current?.focus();\n  }, [phase]);\n\n  function shake() {\n    if (reduced || !pill.current) return;\n    animatePill(pill.current, { x: [0, -6, 5, -3, 1, 0] }, { duration: motionTokens.duration.considered, ease: \"easeOut\" });\n  }\n\n  async function submit(event: FormEvent) {\n    event.preventDefault();\n    if (busy.current || phase !== \"idle\") return;\n    setTried(true);\n    const found = validate(email);\n    setProblem(found);\n    if (found) { shake(); input.current?.focus(); return; }\n    const value = email.trim();\n    busy.current = true;\n    setPhase(\"sending\");\n    try {\n      await (onSubscribe ? onSubscribe(value) : new Promise(resolve => setTimeout(resolve, 1100)));\n      setSentTo(value);\n      setPhase(\"done\");\n    } catch {\n      setPhase(\"idle\");\n      setProblem({ kind: \"failed\", text: MESSAGES.failed });\n      shake();\n    } finally {\n      busy.current = false;\n    }\n  }\n\n  function reset() {\n    setEmail(\"\");\n    setProblem(null);\n    setTried(false);\n    refocus.current = true;\n    setPhase(\"idle\");\n  }\n\n  const done = phase === \"done\";\n  const sending = phase === \"sending\";\n  const messageId = `${id}-message`;\n  const labelKey = done ? \"done\" : sending ? \"sending\" : problem?.kind === \"failed\" ? \"retry\" : \"idle\";\n  const labels: Record<string, ReactNode> = {\n    idle: <>{buttonLabel}<ArrowRight size={16} strokeWidth={1.75} aria-hidden=\"true\" /></>,\n    retry: <>Try again<ArrowRight size={16} strokeWidth={1.75} aria-hidden=\"true\" /></>,\n    sending: <><span className={styles.spinner} aria-hidden=\"true\" />Subscribing</>,\n    done: <><span className={styles.check} aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><motion.path d=\"M5 12.5l4.5 4.5L19 7.5\" initial={reduced ? false : { pathLength: 0 }} animate={{ pathLength: 1 }} transition={{ duration: reduced ? 0 : .34, ease: enter, delay: .12 }} /></svg></span>Subscribed</>,\n  };\n\n  const doneText = \"Check your inbox to confirm.\";\n  const note = <>{privacyNote}{privacyLink && <> <a className={styles.link} href={privacyLink.href}>{privacyLink.label}</a></>}</>;\n  // Plain copies of the note and the confirmation, used only to reserve the line's height.\n  const measures = [<>{privacyNote}{privacyLink && ` ${privacyLink.label}`}</>, `${doneText} Use a different email`, MESSAGES.empty, MESSAGES.format, MESSAGES.failed];\n  const form = <form className={styles.form} onSubmit={submit} noValidate aria-label={title ?? copy.title}>\n    <motion.div ref={pill} className={styles.pill} data-invalid={problem ? \"\" : undefined} data-done={done ? \"\" : undefined}>\n      <label htmlFor={`${id}-email`} className={styles.srOnly}>Email address</label>\n      <input\n        ref={input}\n        id={`${id}-email`}\n        className={styles.input}\n        type=\"email\"\n        name=\"email\"\n        inputMode=\"email\"\n        autoComplete=\"email\"\n        enterKeyHint=\"send\"\n        autoCapitalize=\"off\"\n        spellCheck={false}\n        placeholder={placeholder}\n        value={email}\n        readOnly={phase !== \"idle\"}\n        aria-invalid={problem?.kind === \"invalid\" ? true : undefined}\n        aria-describedby={messageId}\n        onBlur={() => { if (email.trim() && !tried && phase === \"idle\") { setTried(true); setProblem(validate(email)); } }}\n        onChange={event => { setEmail(event.target.value); if (tried) setProblem(validate(event.target.value)); else if (problem) setProblem(null); }}\n      />\n      <motion.button\n        type={done ? \"button\" : \"submit\"}\n        className={styles.submit}\n        data-state={labelKey}\n        aria-busy={sending || undefined}\n        aria-disabled={sending || done || undefined}\n        tabIndex={done ? -1 : undefined}\n        whileTap={{ scale: reduced || sending || done ? 1 : .97 }}\n        transition={motionTokens.spring.snappy}\n      >\n        <span className={styles.labels}>\n          {Object.keys(labels).map(key => <span key={key} className={styles.sizer} aria-hidden=\"true\">{key === \"done\" ? <><span className={styles.check} />Subscribed</> : labels[key]}</span>)}\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            <motion.span key={labelKey} className={styles.label} initial={reduced ? fadeIn : swapIn} animate={swapShown} exit={reduced ? fadeOut : swapOut} transition={{ duration: reduced ? motionTokens.duration.instant : motionTokens.duration.standard, ease: enter }}>\n              {labels[labelKey]}\n            </motion.span>\n          </AnimatePresence>\n        </span>\n      </motion.button>\n    </motion.div>\n    <div className={styles.message}>\n      {/* Every message the line can show sits here unseen, so the line is always as tall as the longest one and nothing below it moves. */}\n      {measures.map((text, index) => <p key={index} className={`${styles.note} ${styles.sizer}`} aria-hidden=\"true\">{text}</p>)}\n      <Swap id={problem ? `problem-${problem.text}` : done ? \"done\" : \"note\"} reduced={reduced} className={styles.messageLive} live=\"polite\">\n        <p id={messageId} className={styles.note} data-tone={problem ? \"error\" : done ? \"success\" : undefined} role={problem ? \"alert\" : undefined}>\n          {problem?.text ?? (done\n            ? <>{doneText}<span className={styles.srOnly}> The link went to {sentTo}.</span> <button ref={again} type=\"button\" className={styles.textButton} onClick={reset}>Use a different email</button></>\n            : note)}\n        </p>\n      </Swap>\n    </div>\n  </form>;\n\n  const root = [styles.newsletter, className].filter(Boolean).join(\" \");\n\n  if (variant === \"card\") {\n    return <section ref={ref} className={root} data-variant=\"card\" aria-labelledby={`${id}-title`}>\n      {/* The shell spans the section so a host layout can set its gutter without reaching into the card. */}\n      <div className={styles.cardShell}>\n      <div className={styles.card}>\n        {publication && <div className={styles.tray}>\n          <IssueStack publication={publication} delivered={done} to={sentTo} reduced={reduced} compact />\n        </div>}\n        <div className={styles.cardBody}>\n          <h2 id={`${id}-title`} className={styles.cardTitle}>{title ?? copy.title}</h2>\n          <p className={styles.description}>{description ?? copy.description}</p>\n          {form}\n          {readers && <Readers readers={readers} done={done} reduced={reduced} />}\n        </div>\n      </div>\n      </div>\n    </section>;\n  }\n\n  return <section ref={ref} className={root} data-variant=\"inline\" data-aside={publication || readers ? \"\" : undefined} aria-labelledby={`${id}-title`}>\n    <div className={styles.inline}>\n      <div className={styles.intro}>\n        <h2 id={`${id}-title`} className={styles.title}>{title ?? copy.title}</h2>\n        <p className={styles.description}>{description ?? copy.description}</p>\n        {form}\n      </div>\n      {(publication || readers) && <div className={styles.aside}>\n        {publication && <IssueStack publication={publication} delivered={done} to={sentTo} reduced={reduced} />}\n        {readers && <Readers readers={readers} done={done} reduced={reduced} />}\n      </div>}\n    </div>\n  </section>;\n});\n\nNewsletterSignup.displayName = \"NewsletterSignup\";\n\nconst variantOptions = [{ value: \"inline\", label: \"Inline\" }, { value: \"card\", label: \"Card\" }];\n\n/** Preview: both layouts. Subscribing is simulated and nothing is sent; the switch makes the next send fail. */\nexport function NewsletterSignupBlock() {\n  const [variant, setVariant] = useState<NewsletterVariant>(\"inline\");\n  const [fail, setFail] = useState(false);\n  const switchId = useId();\n  const simulate = () => new Promise<void>((resolve, reject) => setTimeout(() => fail ? reject(new Error(\"Simulated failure\")) : resolve(), 1100));\n  return <div className={styles.preview}>\n    <div className={styles.controls}>\n      <SegmentedControl label=\"Newsletter layout\" options={variantOptions} value={variant} onValueChange={next => setVariant(next as NewsletterVariant)} />\n      <div className={styles.simulate}>\n        <Switch id={switchId} checked={fail} onCheckedChange={setFail} />\n        <label htmlFor={switchId}>Fail the next send</label>\n      </div>\n    </div>\n    <div className={styles.frame}>\n      <NewsletterSignup key={variant} variant={variant} onSubscribe={simulate} />\n    </div>\n    <p className={styles.caption}>Subscribing is simulated in this preview. Nothing is sent.</p>\n  </div>;\n}\n\nexport default NewsletterSignupBlock;\n"},{"path":"registry/blocks/newsletter-signup/newsletter-signup-data.ts","type":"registry:component","target":"@components/arc/blocks/newsletter-signup/newsletter-signup-data.ts","content":"import { avatar, photo, type PersonId, type PhotoId } from \"../../lib/media\";\n\n/** One story teased in an issue. `image` is a small square-cropped thumbnail. */\nexport interface NewsletterStory {\n  title: string;\n  image: string;\n  minutes: number;\n}\n\n/** One issue of the newsletter, as it appears on the stack. */\nexport interface NewsletterIssue {\n  number: number;\n  /** Send date as it should read, such as \"Friday, September 25\". */\n  date: string;\n  subject: string;\n  /** Up to three stories. */\n  stories: NewsletterStory[];\n}\n\n/** The publication shown beside the form: the next issue lands on the stack of recent ones when someone subscribes. */\nexport interface NewsletterPublication {\n  name: string;\n  /** The next issue. It is addressed to the new reader and joins the front of the stack on success. */\n  upcoming: NewsletterIssue;\n  /** Recent issues, newest first. The first three make the stack. */\n  recent: NewsletterIssue[];\n}\n\nconst story = (title: string, image: PhotoId, minutes: number): NewsletterStory => ({ title, image: photo(image).src, minutes });\n\nexport const newsletterCopy = {\n  inline: {\n    title: \"Five minutes on interface craft, every Friday\",\n    description: \"Three links worth your time and one short essay on the details that make software feel right.\",\n  },\n  card: {\n    title: \"Get the next issue on Friday\",\n    description: \"Three links and one short essay on interface craft. Five minutes, once a week.\",\n  },\n  privacy: \"No tracking pixels. Unsubscribe with one click.\",\n  privacyLink: { label: \"Privacy policy\", href: \"#privacy\" },\n};\n\n/** Sample publication. Dates follow a Friday send; images come from `public/media/photos`. */\nexport const newsletterPublication: NewsletterPublication = {\n  name: \"Margins\",\n  upcoming: {\n    number: 149,\n    date: \"Friday, October 2\",\n    subject: \"Designing for the second visit, not the first\",\n    stories: [\n      story(\"Empty states that invite a first step\", \"reading-chair\", 5),\n      story(\"Texture without noise, from a ceramics studio\", \"stacked-bowls\", 4),\n      story(\"How a concert hall seats two thousand people\", \"concert-hall\", 7),\n    ],\n  },\n  recent: [\n    {\n      number: 148,\n      date: \"Friday, September 25\",\n      subject: \"Why the best settings pages feel quiet\",\n      stories: [\n        story(\"What a sunroom teaches about contrast\", \"sunroom\", 4),\n        story(\"The case for a single accent color\", \"ceramic-lamp\", 3),\n        story(\"Lisbon tram signs and wayfinding at scale\", \"lisbon-tram\", 6),\n      ],\n    },\n    {\n      number: 147,\n      date: \"Friday, September 18\",\n      subject: \"Springs that settle instead of bounce\",\n      stories: [\n        story(\"Reading the ridge line of an animation curve\", \"mountain-ridges\", 5),\n        story(\"A table lamp and the warmth of dark mode\", \"table-lamp\", 3),\n        story(\"Curves in architecture and in corners\", \"curved-facade\", 4),\n      ],\n    },\n    {\n      number: 146,\n      date: \"Friday, September 11\",\n      subject: \"Copy that sounds like a person\",\n      stories: [\n        story(\"Error messages that take the blame\", \"glass-carafe\", 4),\n        story(\"Writing buttons as verbs\", \"home-office\", 3),\n        story(\"Tone of voice at the dinner table\", \"salmon-dinner\", 5),\n      ],\n    },\n  ],\n};\n\n/** Readers shown under the stack and in the card. */\nexport const newsletterReaders = {\n  count: 12480,\n  faces: ([\"jasmine-brooks\", \"daniel-kim\", \"ava-mitchell\"] as PersonId[]).map(id => avatar(id)),\n};\n"},{"path":"lib/media.ts","type":"registry:lib","target":"@components/arc/lib/media.ts","content":"/**\n * Shared demo media. Files live in `public/media/`, credits in `public/media/CREDITS.md`.\n * People are seeded gradient avatars from `npm run avatars` (400 px squares);\n * photos are 1600 px on the long side.\n */\n\nexport interface MediaPerson {\n  id: string;\n  name: string;\n  role?: string;\n  src: string;\n}\n\nexport interface MediaPhoto {\n  id: string;\n  alt: string;\n  src: string;\n  width: number;\n  height: number;\n}\n\nexport const people = [\n  { id: \"emma-collins\", name: \"Emma Collins\", role: \"Product designer\", src: \"/media/people/emma-collins.svg\" },\n  { id: \"marcus-johnson\", name: \"Marcus Johnson\", role: \"Frontend engineer\", src: \"/media/people/marcus-johnson.svg\" },\n  { id: \"jasmine-brooks\", name: \"Jasmine Brooks\", role: \"Design lead\", src: \"/media/people/jasmine-brooks.svg\" },\n  { id: \"olivia-bennett\", name: \"Olivia Bennett\", role: \"Platform engineer\", src: \"/media/people/olivia-bennett.svg\" },\n  { id: \"sofia-ramirez\", name: \"Sofia Ramirez\", role: \"Operations lead\", src: \"/media/people/sofia-ramirez.svg\" },\n  { id: \"ryan-sullivan\", name: \"Ryan Sullivan\", role: \"Account executive\", src: \"/media/people/ryan-sullivan.svg\" },\n  { id: \"hannah-walsh\", name: \"Hannah Walsh\", role: \"Customer success\", src: \"/media/people/hannah-walsh.svg\" },\n  { id: \"chloe-nguyen\", name: \"Chloe Nguyen\", role: \"Data analyst\", src: \"/media/people/chloe-nguyen.svg\" },\n  { id: \"ava-mitchell\", name: \"Ava Mitchell\", role: \"Marketing manager\", src: \"/media/people/ava-mitchell.svg\" },\n  { id: \"daniel-kim\", name: \"Daniel Kim\", role: \"Backend engineer\", src: \"/media/people/daniel-kim.svg\" },\n  { id: \"jordan-reyes\", name: \"Jordan Reyes\", role: \"Support specialist\", src: \"/media/people/jordan-reyes.svg\" },\n  { id: \"mateo-alvarez\", name: \"Mateo Alvarez\", role: \"Mobile engineer\", src: \"/media/people/mateo-alvarez.svg\" },\n  { id: \"tyler-hayes\", name: \"Tyler Hayes\", role: \"Sales lead\", src: \"/media/people/tyler-hayes.svg\" },\n  { id: \"andre-williams\", name: \"Andre Williams\", role: \"Finance partner\", src: \"/media/people/andre-williams.svg\" },\n  { id: \"nathan-cole\", name: \"Nathan Cole\", role: \"Engineering manager\", src: \"/media/people/nathan-cole.svg\" },\n  { id: \"diane-foster\", name: \"Diane Foster\", role: \"Chief operating officer\", src: \"/media/people/diane-foster.svg\" },\n] as const satisfies readonly MediaPerson[];\n\nexport const photos = [\n  { id: \"lounge-chair\", alt: \"A woven oak lounge chair with a sheepskin and linen cushion on a concrete floor\", src: \"/media/photos/lounge-chair.jpg\", width: 1280, height: 1600 },\n  { id: \"table-lamp\", alt: \"A white mushroom table lamp glowing beside books and a small vase\", src: \"/media/photos/table-lamp.jpg\", width: 1600, height: 900 },\n  { id: \"linen-throw\", alt: \"Folded natural linen throws with fringed edges in soft window light\", src: \"/media/photos/linen-throw.jpg\", width: 1067, height: 1600 },\n  { id: \"glass-carafe\", alt: \"A hand pouring water from a ribbed glass carafe into tumblers\", src: \"/media/photos/glass-carafe.jpg\", width: 1280, height: 1600 },\n  { id: \"stoneware-cups\", alt: \"Two speckled stoneware cups with a lid on a pale table\", src: \"/media/photos/stoneware-cups.jpg\", width: 1067, height: 1600 },\n  { id: \"stacked-bowls\", alt: \"Two stacked speckled ceramic bowls against a dark wall\", src: \"/media/photos/stacked-bowls.jpg\", width: 1600, height: 1067 },\n  { id: \"ceramic-lamp\", alt: \"A sculptural ceramic lamp with a linen shade on a walnut sideboard\", src: \"/media/photos/ceramic-lamp.jpg\", width: 1067, height: 1600 },\n  { id: \"living-room\", alt: \"A bright living room with timber beams, arched windows, and cream sofas\", src: \"/media/photos/living-room.jpg\", width: 1200, height: 1600 },\n  { id: \"sunroom\", alt: \"A sunroom with a round dining table, plants, and windows on three sides\", src: \"/media/photos/sunroom.jpg\", width: 1600, height: 1067 },\n  { id: \"home-office\", alt: \"A home office with a wooden desk and deep green walls\", src: \"/media/photos/home-office.jpg\", width: 1600, height: 1200 },\n  { id: \"reading-chair\", alt: \"A grey armchair and ottoman with a knit throw in a dark green room\", src: \"/media/photos/reading-chair.jpg\", width: 1600, height: 900 },\n  { id: \"bedroom\", alt: \"A made bed with striped linen pillows against an oak headboard\", src: \"/media/photos/bedroom.jpg\", width: 1067, height: 1600 },\n  { id: \"restaurant\", alt: \"A warm restaurant dining room with woven pendant lights and a tree\", src: \"/media/photos/restaurant.jpg\", width: 1067, height: 1600 },\n  { id: \"wine-bar\", alt: \"A glass carafe of red wine on a bar table in low evening light\", src: \"/media/photos/wine-bar.jpg\", width: 1600, height: 1067 },\n  { id: \"concert-hall\", alt: \"Curved stainless steel panels of the Walt Disney Concert Hall against a blue sky\", src: \"/media/photos/concert-hall.jpg\", width: 1600, height: 1143 },\n  { id: \"curved-facade\", alt: \"A white tiled building facade with curved balconies\", src: \"/media/photos/curved-facade.jpg\", width: 1600, height: 1067 },\n  { id: \"pool-house\", alt: \"A modern glass house beside a long pool under a clear sky\", src: \"/media/photos/pool-house.jpg\", width: 1600, height: 900 },\n  { id: \"terracotta-waves\", alt: \"Wavy terracotta walls rising toward a blue sky\", src: \"/media/photos/terracotta-waves.jpg\", width: 1067, height: 1600 },\n  { id: \"mountain-ridges\", alt: \"Layered mountain ridges under a warm evening sky\", src: \"/media/photos/mountain-ridges.jpg\", width: 1600, height: 1068 },\n  { id: \"alpine-lake\", alt: \"A calm alpine lake reflecting a rocky peak at golden hour\", src: \"/media/photos/alpine-lake.jpg\", width: 1067, height: 1600 },\n  { id: \"coastline\", alt: \"A long coastline with waves rolling onto a beach below green cliffs\", src: \"/media/photos/coastline.jpg\", width: 1200, height: 1600 },\n  { id: \"sea-at-dusk\", alt: \"A calm sea at dusk with a low island on the horizon\", src: \"/media/photos/sea-at-dusk.jpg\", width: 1067, height: 1600 },\n  { id: \"lisbon-tram\", alt: \"A yellow tram on a street lined with historic buildings in Lisbon\", src: \"/media/photos/lisbon-tram.jpg\", width: 1600, height: 1064 },\n  { id: \"lisbon-bridge\", alt: \"The 25 de Abril Bridge crossing the Tagus in Lisbon\", src: \"/media/photos/lisbon-bridge.jpg\", width: 1600, height: 1166 },\n  { id: \"lisbon-rooftops\", alt: \"Terracotta rooftops of Lisbon running down to the river\", src: \"/media/photos/lisbon-rooftops.jpg\", width: 1280, height: 1600 },\n  { id: \"salmon-dinner\", alt: \"Seared salmon with a bright herb salsa and a glass of red wine\", src: \"/media/photos/salmon-dinner.jpg\", width: 1067, height: 1600 },\n  { id: \"chef-plating\", alt: \"A chef spooning sauce onto a plated dish in a dark kitchen\", src: \"/media/photos/chef-plating.jpg\", width: 1600, height: 1600 },\n] as const satisfies readonly MediaPhoto[];\n\nexport type PersonId = (typeof people)[number][\"id\"];\nexport type PhotoId = (typeof photos)[number][\"id\"];\n\n/** Looks up a person by id. */\nexport function person(id: PersonId): MediaPerson {\n  return people.find(entry => entry.id === id)!;\n}\n\n/** Looks up a photo by id. */\nexport function photo(id: PhotoId): MediaPhoto {\n  return photos.find(entry => entry.id === id)!;\n}\n\n/** Square 400 px avatar path for a person id, for `src` props. */\nexport const avatar = (id: PersonId) => person(id).src;\n\n/** 800 × 1000 portrait of the same avatar, for image-led layouts. */\nexport const portrait = (id: PersonId) => `/media/people/portrait/${id}.svg`;\n\n/** The first `count` people, for avatar stacks and lists. */\nexport const peopleSample = (count: number) => people.slice(0, count);\n"},{"path":"registry/blocks/newsletter-signup/newsletter-signup.module.css","type":"registry:component","target":"@components/arc/blocks/newsletter-signup/newsletter-signup.module.css","content":".newsletter {\n  --paper: var(--surface-raised);\n  --paper-back: color-mix(in oklab, var(--surface-raised), var(--surface-muted) 55%);\n  --paper-far: var(--surface-muted);\n  --paper-shadow: 0 1px 1px oklch(0% 0 0 / .03), 0 10px 28px -6px oklch(0% 0 0 / .09);\n  container: newsletter / inline-size;\n  background: var(--background);\n  color: var(--foreground);\n  font-family: var(--font-body);\n  letter-spacing: var(--tracking-body);\n  text-align: start;\n}\n:global(:root[data-theme=\"dark\"]) .newsletter {\n  --paper: oklch(24.5% 0 0);\n  --paper-back: oklch(22.5% 0 0);\n  --paper-far: oklch(21% 0 0);\n  --paper-shadow: 0 1px 1px oklch(0% 0 0 / .2), 0 14px 32px -6px oklch(0% 0 0 / .45);\n}\n.newsletter *, .newsletter *::before, .newsletter *::after { box-sizing: border-box; }\n.srOnly { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n\n/* Inline: copy and form on the left, the issue stack on the right. */\n.inline { display: grid; max-width: 1120px; grid-template-columns: minmax(0, 1fr); gap: var(--space-12) var(--space-16); margin: 0 auto; padding: var(--space-24) var(--space-8); }\n.newsletter[data-aside] .inline { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; }\n/* Without the stack or readers the section is the copy and form alone. */\n.newsletter[data-variant=\"inline\"]:not([data-aside]) .inline { max-width: 720px; }\n.intro { display: grid; max-width: 540px; }\n.title { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 1.1rem + 3.2cqi, var(--text-4xl)); font-weight: 500; letter-spacing: var(--tracking-display); line-height: var(--leading-display); text-wrap: balance; }\n.description { margin: var(--space-4) 0 0; color: var(--text-secondary); font-size: var(--text-lg); line-height: var(--leading-body); text-wrap: pretty; }\n.intro .form { margin-top: var(--space-10); }\n.aside { display: grid; justify-items: center; gap: var(--space-6); min-width: 0; }\n\n/* The stack: every issue shares one grid cell, so the stack is as tall as one issue and nothing shifts when they trade places. */\n.stack { display: grid; width: 100%; max-width: 440px; padding-top: calc(12px * 2); }\n.issue {\n  display: grid;\n  grid-area: 1 / 1;\n  align-content: start;\n  min-width: 0;\n  border: 1px solid var(--border);\n  border-radius: 22px;\n  padding: 22px 22px 18px;\n  background: var(--paper);\n  box-shadow: var(--paper-shadow);\n  transform-origin: 50% 0;\n  transition: background-color var(--duration-considered) var(--ease-standard);\n}\n.issueSizer { visibility: hidden; box-shadow: none; }\n.issue[data-depth=\"1\"] { background: var(--paper-back); box-shadow: none; }\n.issue[data-depth=\"2\"] { background: var(--paper-far); box-shadow: none; }\n.issueHead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }\n.masthead { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; letter-spacing: var(--tracking-display); line-height: var(--leading-display); }\n.issueNumber, .issueMeta { color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); font-variant-numeric: tabular-nums; }\n.issueMeta { display: flex; min-width: 0; gap: 6px; margin: 2px 0 0; white-space: nowrap; }\n.issueMeta > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }\n.recipient { color: var(--text-secondary); }\n.recipientEmail { color: var(--foreground); }\n.subject { min-height: calc(2em * var(--leading-display)); margin: var(--space-5) 0 var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-5); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 500; letter-spacing: var(--tracking-display); line-height: var(--leading-display); text-wrap: balance; box-sizing: content-box; }\n.stack[data-compact] .subject { font-size: var(--text-xl); }\n.stories { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }\n.story { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; }\n.thumb { display: block; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-muted); }\n.storyTitle { display: -webkit-box; overflow: hidden; color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--leading-body); -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-wrap: pretty; }\n.minutes { color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }\n\n/* Readers: faces and a count that ticks up by one. */\n.readers { display: flex; align-items: center; gap: var(--space-3); color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--leading-body); }\n.faces { display: flex; flex: none; padding-left: 6px; }\n.faces img { display: block; width: 28px; height: 28px; margin-left: -6px; border: 2px solid var(--background); border-radius: 50%; object-fit: cover; }\n.card .faces img { border-color: var(--surface); }\n.readerLine { min-width: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }\n.count { display: inline-block; color: var(--foreground); }\n.count > span { color: inherit; font-family: inherit; font-size: inherit; font-weight: 500; letter-spacing: inherit; line-height: inherit; vertical-align: bottom; }\n.you { display: inline-block; overflow: hidden; color: var(--text-secondary); vertical-align: bottom; white-space: nowrap; }\n\n/* Card: a self-contained card whose top is a tray holding the stack, cropped where the card body begins. */\n.newsletter[data-variant=\"card\"] { padding: var(--space-20) var(--space-6); }\n.cardShell { display: grid; width: 100%; place-items: center; }\n.card { display: grid; width: min(100%, 460px); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-surface); background: var(--surface); box-shadow: var(--shadow-resting); }\n.tray { display: grid; height: 248px; grid-template-rows: minmax(0, 1fr); overflow: hidden; justify-items: center; border-bottom: 1px solid var(--border); padding: 20px 32px 0; background: var(--surface-muted); }\n.tray .stack { height: 100%; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent); }\n.tray .issue { box-shadow: none; }\n.cardBody { display: grid; padding: var(--space-8); }\n.cardTitle { margin: 0; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 500; letter-spacing: var(--tracking-display); line-height: var(--leading-display); text-wrap: balance; }\n.card .description { margin-top: var(--space-2); font-size: var(--text-base); }\n.card .form { margin-top: var(--space-6); }\n.card .readers { margin-top: var(--space-5); border-top: 1px solid var(--border-subtle); padding-top: var(--space-5); }\n:global(:root[data-theme=\"dark\"]) .tray { background: var(--background); }\n\n/* The pill: one field that holds the input and the button. */\n.form { container: signup / inline-size; display: grid; gap: var(--space-3); min-width: 0; }\n.pill { position: relative; display: flex; height: 58px; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 5px 5px 22px; background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-standard) var(--ease-standard); }\n@media (hover: hover) and (pointer: fine) { .pill:not([data-done]):hover { border-color: color-mix(in oklab, var(--foreground) 32%, var(--border-strong)); } }\n.pill:focus-within { border-color: var(--foreground); }\n.pill.pill[data-invalid] { border-color: var(--danger); }\n.pill.pill[data-done] { border-color: color-mix(in oklab, var(--success) 45%, var(--border)); }\n.input { width: 100%; min-width: 0; height: 100%; flex: 1; border: 0; padding: 0; background: none; color: var(--foreground); font: inherit; font-size: var(--text-base); letter-spacing: inherit; outline: none; transition: color var(--duration-standard) var(--ease-standard); }\n.input::placeholder { color: var(--text-muted); }\n.pill[data-done] .input { color: var(--text-secondary); }\n\n.submit { position: relative; display: inline-flex; height: 100%; min-height: 44px; flex: none; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 0 20px; background: var(--foreground); color: var(--background); font: inherit; font-size: var(--text-sm); font-weight: 500; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-standard) var(--ease-standard), color var(--duration-standard) var(--ease-standard); }\n@media (hover: hover) and (pointer: fine) { .submit[data-state=\"idle\"]:hover, .submit[data-state=\"retry\"]:hover { background: color-mix(in oklab, var(--foreground) 84%, var(--background)); } }\n.submit[data-state=\"sending\"] { cursor: progress; }\n.submit[data-state=\"done\"] { background: color-mix(in oklab, var(--success) 13%, var(--surface)); color: var(--success); cursor: default; }\n.labels { display: inline-grid; place-items: center; }\n.sizer, .label { display: inline-flex; grid-area: 1 / 1; align-items: center; gap: 8px; }\n.sizer { visibility: hidden; }\n.note.sizer { display: block; }\n.spinner { width: 14px; height: 14px; border: 2px solid color-mix(in oklab, currentColor 30%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin 700ms linear infinite; }\n@keyframes spin { to { transform: rotate(360deg); } }\n.check { display: inline-flex; width: 16px; height: 16px; }\n.check svg { width: 16px; height: 16px; }\n\n/* Two lines are reserved so the note, an error, and the confirmation never move what sits below. */\n.message { display: grid; }\n.message > * { grid-area: 1 / 1; min-width: 0; }\n.messageLive { position: relative; }\n.note { margin: 0; padding-left: 22px; color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-body); text-wrap: pretty; }\n.note[data-tone=\"error\"] { color: var(--danger); }\n.note[data-tone=\"success\"] { color: var(--text-secondary); }\n.link, .textButton { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color var(--duration-fast) var(--ease-standard); }\n.textButton { border: 0; padding: 0; background: none; font: inherit; cursor: pointer; }\n@media (hover: hover) and (pointer: fine) { .link:hover, .textButton:hover { text-decoration-color: currentColor; } }\n\n@container newsletter (max-width: 860px) {\n  .newsletter[data-variant=\"inline\"] .inline { grid-template-columns: minmax(0, 1fr); gap: var(--space-12); padding: var(--space-16) var(--space-8); }\n  .intro { max-width: 600px; }\n}\n@container newsletter (max-width: 520px) {\n  .newsletter[data-variant=\"inline\"] .inline { padding: var(--space-12) var(--space-4); gap: var(--space-10); }\n  .description { font-size: var(--text-base); }\n  .intro .form { margin-top: var(--space-8); }\n  .issue { border-radius: 20px; padding: 18px 18px 16px; }\n  .subject, .stack[data-compact] .subject { font-size: var(--text-xl); }\n  .newsletter[data-variant=\"card\"] { padding: var(--space-10) var(--space-4); }\n  .card { border-radius: 28px; }\n  .tray { height: 232px; padding: 16px 20px 0; }\n  .cardBody { padding: var(--space-6); }\n  .note { padding-left: 4px; }\n}\n@container newsletter (max-width: 400px) {\n  .minutes { display: none; }\n  /* The recipient matters more than the date once the issue is addressed. */\n  .issueMeta:has(.recipient) > :not(.recipient) { display: none; }\n  .story { grid-template-columns: 44px minmax(0, 1fr); }\n  .faces img { width: 24px; height: 24px; }\n  .readers { gap: var(--space-2); }\n}\n@container newsletter (max-width: 360px) {\n  .readers { align-items: flex-start; }\n  .readerLine { min-height: calc(2 * 1.4em); white-space: normal; }\n}\n/* On narrow phones the field and the button separate and stack, both full width. */\n@container signup (max-width: 300px) {\n  .pill { height: auto; flex-direction: column; align-items: stretch; gap: 8px; border: 0; padding: 0; background: none; }\n  .input { height: 52px; flex: none; border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 20px; background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard), color var(--duration-standard) var(--ease-standard); }\n  .input:focus { border-color: var(--foreground); }\n  .pill.pill[data-invalid] .input { border-color: var(--danger); }\n  .pill.pill[data-done] .input { border-color: color-mix(in oklab, var(--success) 45%, var(--border)); }\n  .submit { height: 48px; }\n  .note { padding-left: 4px; }\n}\n\n/* Preview chrome. */\n.preview { display: grid; width: 100%; justify-items: center; gap: var(--space-4); }\n.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-3) var(--space-6); }\n.simulate { display: inline-flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: var(--text-sm); }\n.simulate label { cursor: pointer; }\n.frame { width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: var(--background); }\n.caption { margin: 0; color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); text-align: center; }\n\n@media (prefers-reduced-motion: reduce) {\n  .pill, .submit, .input, .issue { transition: none; }\n  .spinner { animation-duration: 1.6s; }\n}\n"}],"docs":"Use this to collect newsletter or waitlist emails. Pass onSubscribe to call your email provider and throw on failure; subscribing in the preview is simulated.","meta":{"tier":"free","kind":"block","builtFrom":["Segmented control"],"docs":"https://uiarc.dev/components/blocks/newsletter-signup"}}