{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footers-01",
  "title": "Footer with categories and a newsletter",
  "description": "Four lists of links beside the brand and a newsletter field that checks the address, shows its submitting state and morphs into a confirmation.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/animated-size.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/field.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/input.json",
    "https://ui.ndekocode.dev/r/status-orb.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/footers/footers-01/index.tsx",
      "content": "import { Button } from '@/registry/ndeko/ui/button';\n\nimport { LoomboardMark } from './brand-mark';\nimport { BRAND, CATEGORIES, SOCIAL_LINKS } from './data';\nimport { NewsletterForm } from './newsletter-form';\n\nexport default function Footers01() {\n  return (\n    <footer className='px-4 pt-16 pb-10 sm:px-6 lg:px-8'>\n      <div className='mx-auto flex max-w-6xl flex-col gap-14'>\n        <div className='grid gap-12 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)] lg:gap-16'>\n          <div className='flex flex-col items-start gap-6'>\n            <div className='flex flex-col gap-3'>\n              <a\n                href='#'\n                className='focus-visible:ring-ring/25 flex items-center gap-2 self-start rounded-md text-sm font-semibold outline-none focus-visible:ring-[3px]'\n              >\n                <LoomboardMark />\n                {BRAND.name}\n              </a>\n              <p className='text-muted-foreground max-w-xs text-[13px] text-pretty'>\n                {BRAND.tagline}\n              </p>\n            </div>\n            <NewsletterForm />\n          </div>\n          <nav\n            aria-label='Footer'\n            className='grid grid-cols-2 gap-x-6 gap-y-10 sm:grid-cols-4'\n          >\n            {CATEGORIES.map((category) => (\n              <div key={category.title} className='flex flex-col gap-3'>\n                <h2 className='text-muted-foreground text-xs font-medium'>\n                  {category.title}\n                </h2>\n                <ul className='flex flex-col gap-2'>\n                  {category.links.map((link) => (\n                    <li key={link.label}>\n                      <a\n                        href={link.href}\n                        className='text-foreground/80 hover:text-foreground focus-visible:ring-ring/25 rounded-sm text-[13px] transition-colors outline-none focus-visible:ring-[3px]'\n                      >\n                        {link.label}\n                      </a>\n                    </li>\n                  ))}\n                </ul>\n              </div>\n            ))}\n          </nav>\n        </div>\n        <div className='flex flex-col-reverse gap-4 sm:flex-row sm:items-center sm:justify-between'>\n          <p className='text-muted-foreground text-xs'>{BRAND.copyright}</p>\n          <ul className='-ms-2 flex items-center gap-1 sm:ms-0'>\n            {SOCIAL_LINKS.map((link) => (\n              <li key={link.label}>\n                <Button\n                  variant='ghost'\n                  size='icon'\n                  className='text-muted-foreground'\n                  aria-label={link.label}\n                  nativeButton={false}\n                  render={<a href={link.href} />}\n                >\n                  <link.icon />\n                </Button>\n              </li>\n            ))}\n          </ul>\n        </div>\n      </div>\n    </footer>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/footers-01/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/footers/footers-01/newsletter-form.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { LoaderCircleIcon } from '@/registry/ndeko/lib/icons';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  Field,\n  FieldDescription,\n  FieldError,\n  FieldLabel,\n} from '@/registry/ndeko/ui/field';\nimport { Input } from '@/registry/ndeko/ui/input';\nimport { StatusOrb } from '@/registry/ndeko/ui/status-orb';\n\nimport { NEWSLETTER } from './data';\n\ntype Status = 'idle' | 'submitting' | 'subscribed';\n\nconst SUBMIT_DELAY_MS = 800;\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nconst PANEL_TRANSITION: Transition = {\n  duration: 0.2,\n  ease: [0.23, 1, 0.32, 1],\n};\n\nconst LABEL_TRANSITION: Transition = {\n  type: 'spring',\n  bounce: 0,\n  duration: 0.3,\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\nconst PANEL_VARIANTS: Variants = {\n  enter: { opacity: 0, scale: 0.98, filter: 'blur(2px)' },\n  visible: { opacity: 1, scale: 1, filter: 'blur(0px)' },\n  exit: { opacity: 0, scale: 0.98, filter: 'blur(2px)' },\n};\n\nconst SPINNER_VARIANTS: Variants = {\n  enter: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n  visible: { opacity: 1, scale: 1, filter: 'blur(0px)' },\n  exit: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1 },\n  exit: { opacity: 0 },\n};\n\nfunction emailErrorOf(value: string) {\n  const trimmed = value.trim();\n  if (trimmed.length === 0) {\n    return 'Enter an email address to subscribe';\n  }\n  const isEmailShaped = EMAIL_PATTERN.test(trimmed);\n  if (!isEmailShaped) {\n    return 'Check the address, it should look like name@example.com';\n  }\n  return null;\n}\n\nfunction submitLabelOf(isSubmitting: boolean) {\n  if (isSubmitting) {\n    return 'Subscribing';\n  }\n  return 'Subscribe';\n}\n\nfunction panelVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return PANEL_VARIANTS;\n}\n\nfunction spinnerVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SPINNER_VARIANTS;\n}\n\nfunction labelTransitionOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return LABEL_TRANSITION;\n}\n\nexport function NewsletterForm() {\n  const [email, setEmail] = useState('');\n  const [error, setError] = useState<string | null>(null);\n  const [hasTriedSubmit, setHasTriedSubmit] = useState(false);\n  const [status, setStatus] = useState<Status>('idle');\n  const inputRef = useRef<HTMLInputElement>(null);\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const panelVariants = panelVariantsOf(shouldReduceMotion);\n  const spinnerVariants = spinnerVariantsOf(shouldReduceMotion);\n  const labelTransition = labelTransitionOf(shouldReduceMotion);\n  const isSubmitting = status === 'submitting';\n  const isSubscribed = status === 'subscribed';\n  const hasError = error !== null;\n  const submitLabel = submitLabelOf(isSubmitting);\n  const trimmedEmail = email.trim();\n\n  useEffect(() => {\n    if (!isSubmitting) {\n      return;\n    }\n    const timeout = window.setTimeout(() => {\n      setStatus('subscribed');\n    }, SUBMIT_DELAY_MS);\n    return () => window.clearTimeout(timeout);\n  }, [isSubmitting]);\n\n  function changeEmail(event: React.ChangeEvent<HTMLInputElement>) {\n    const nextEmail = event.target.value;\n    setEmail(nextEmail);\n    if (hasTriedSubmit) {\n      setError(emailErrorOf(nextEmail));\n    }\n  }\n\n  function submit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    const nextError = emailErrorOf(email);\n    setHasTriedSubmit(true);\n    setError(nextError);\n    if (nextError) {\n      inputRef.current?.focus();\n      return;\n    }\n    setStatus('submitting');\n  }\n\n  function startOver() {\n    setEmail('');\n    setError(null);\n    setHasTriedSubmit(false);\n    setStatus('idle');\n  }\n\n  return (\n    <AnimatedSize className='w-full max-w-sm' contentClassName='relative'>\n      <AnimatePresence mode='popLayout' initial={false}>\n        {isSubscribed && (\n          <motion.div\n            key='subscribed'\n            role='status'\n            variants={panelVariants}\n            initial='enter'\n            animate='visible'\n            exit='exit'\n            transition={PANEL_TRANSITION}\n            className='flex items-start gap-3'\n          >\n            <StatusOrb tone='success' size='sm' />\n            <div className='flex min-w-0 flex-col items-start gap-0.5'>\n              <p className='text-[13px] font-medium'>You are subscribed</p>\n              <p className='text-muted-foreground text-[13px]'>\n                The next update goes to{' '}\n                <span className='text-foreground font-medium break-all'>\n                  {trimmedEmail}\n                </span>\n                .\n              </p>\n              <Button\n                variant='link'\n                size='sm'\n                className='h-auto px-0 py-0.5'\n                onClick={startOver}\n              >\n                Use another address\n              </Button>\n            </div>\n          </motion.div>\n        )}\n        {!isSubscribed && (\n          <motion.form\n            key='form'\n            noValidate\n            onSubmit={submit}\n            variants={panelVariants}\n            initial='enter'\n            animate='visible'\n            exit='exit'\n            transition={PANEL_TRANSITION}\n          >\n            <Field invalid={hasError}>\n              <FieldLabel>{NEWSLETTER.label}</FieldLabel>\n              <div className='flex gap-2'>\n                <Input\n                  ref={inputRef}\n                  type='email'\n                  name='email'\n                  autoComplete='email'\n                  placeholder='you@example.com'\n                  value={email}\n                  onChange={changeEmail}\n                  readOnly={isSubmitting}\n                />\n                <Button\n                  type='submit'\n                  variant='outline'\n                  disabled={isSubmitting}\n                  focusableWhenDisabled\n                  className='data-disabled:opacity-100'\n                >\n                  <AnimatePresence mode='popLayout' initial={false}>\n                    {isSubmitting && (\n                      <motion.span\n                        key='spinner'\n                        className='flex'\n                        variants={spinnerVariants}\n                        initial='enter'\n                        animate='visible'\n                        exit='exit'\n                        transition={PANEL_TRANSITION}\n                      >\n                        <LoaderCircleIcon className='animate-spin' />\n                      </motion.span>\n                    )}\n                  </AnimatePresence>\n                  <motion.span layout transition={labelTransition}>\n                    {submitLabel}\n                  </motion.span>\n                </Button>\n              </div>\n              {hasError && <FieldError match>{error}</FieldError>}\n              {!hasError && (\n                <FieldDescription>{NEWSLETTER.description}</FieldDescription>\n              )}\n            </Field>\n          </motion.form>\n        )}\n      </AnimatePresence>\n    </AnimatedSize>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/footers-01/newsletter-form.tsx"
    },
    {
      "path": "registry/ndeko/blocks/footers/footers-01/brand-mark.tsx",
      "content": "import { cn } from '@/registry/ndeko/lib/utils';\n\nexport function LoomboardMark({ className }: { className?: string }) {\n  return (\n    <svg\n      viewBox='0 0 24 24'\n      aria-hidden='true'\n      className={cn('size-6 shrink-0', className)}\n    >\n      <rect width='24' height='24' rx='7' className='fill-primary' />\n      <rect x='6' y='6' width='3' height='12' rx='1.5' className='fill-white' />\n      <rect\n        x='10.5'\n        y='6'\n        width='3'\n        height='8'\n        rx='1.5'\n        className='fill-white/80'\n      />\n      <rect\n        x='15'\n        y='6'\n        width='3'\n        height='10'\n        rx='1.5'\n        className='fill-white/60'\n      />\n    </svg>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/footers-01/brand-mark.tsx"
    },
    {
      "path": "registry/ndeko/blocks/footers/footers-01/data.ts",
      "content": "import {\n  GithubIcon,\n  type Icon,\n  LinkedinBrandIcon,\n  TwitterXIcon,\n} from '@/registry/ndeko/lib/icons';\n\nexport type FooterLink = {\n  label: string;\n  href: string;\n};\n\nexport type FooterCategory = {\n  title: string;\n  links: FooterLink[];\n};\n\nexport type SocialLink = {\n  label: string;\n  href: string;\n  icon: Icon;\n};\n\nexport const BRAND = {\n  name: 'Loomboard',\n  tagline: 'Boards, timelines and reports for teams that plan every week',\n  copyright: '© 2026 Loomboard Ltd',\n};\n\nexport const NEWSLETTER = {\n  label: 'Product updates',\n  description:\n    'One email a month with what shipped, each with an unsubscribe link',\n};\n\nexport const CATEGORIES: FooterCategory[] = [\n  {\n    title: 'Product',\n    links: [\n      { label: 'Boards', href: '#' },\n      { label: 'Timelines', href: '#' },\n      { label: 'Automations', href: '#' },\n      { label: 'Reports', href: '#' },\n      { label: 'Pricing', href: '#' },\n    ],\n  },\n  {\n    title: 'Resources',\n    links: [\n      { label: 'Documentation', href: '#' },\n      { label: 'Templates', href: '#' },\n      { label: 'Changelog', href: '#' },\n      { label: 'Status', href: '#' },\n    ],\n  },\n  {\n    title: 'Company',\n    links: [\n      { label: 'About', href: '#' },\n      { label: 'Careers', href: '#' },\n      { label: 'Contact', href: '#' },\n    ],\n  },\n  {\n    title: 'Legal',\n    links: [\n      { label: 'Privacy', href: '#' },\n      { label: 'Terms', href: '#' },\n      { label: 'Cookies', href: '#' },\n    ],\n  },\n];\n\nexport const SOCIAL_LINKS: SocialLink[] = [\n  { label: 'Loomboard on GitHub', href: '#', icon: GithubIcon },\n  { label: 'Loomboard on X', href: '#', icon: TwitterXIcon },\n  { label: 'Loomboard on LinkedIn', href: '#', icon: LinkedinBrandIcon },\n];\n",
      "type": "registry:component",
      "target": "components/blocks/footers-01/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "footers"
  ],
  "type": "registry:block"
}