{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "testimonials-01",
  "title": "Quote wall",
  "description": "Sample customer quotes on a masonry wall with one phrase of each in the brand ink: pick a theme and a marker sweeps under the phrases that say it while the other quotes step back to muted text.",
  "dependencies": [
    ",\n      },\n      { kind: "
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/avatar.json",
    "https://ui.ndekocode.dev/r/badge.json",
    "https://ui.ndekocode.dev/r/brand-logos.json",
    "https://ui.ndekocode.dev/r/brand-tile.json",
    "https://ui.ndekocode.dev/r/company-mark.json",
    "https://ui.ndekocode.dev/r/demonstration.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/live-region.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/toggle-group.json",
    "https://ui.ndekocode.dev/r/use-autoplay.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/testimonials/testimonials-01/index.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { useAutoplay } from '@/registry/ndeko/hooks/use-autoplay';\nimport { PRESS_LEAD_MS, usePress } from '@/registry/ndeko/lib/demonstration';\nimport { QuoteIcon } from '@/registry/ndeko/lib/icons';\nimport { Badge } from '@/registry/ndeko/ui/badge';\nimport { LiveRegion } from '@/registry/ndeko/ui/live-region';\n\nimport { QUOTES, SECTION, type ThemeChoice } from './data';\nimport { QuoteCard } from './quote-card';\nimport { spokenLineOf, ThemePicker } from './theme-picker';\n\nconst DEMO_THEMES: ThemeChoice[] = ['replies', 'handoffs', 'setup', 'all'];\n\nconst FIRST_PICK_MS = 2200;\n\nconst READ_MS = 3400;\n\nconst LOOP_AFTER_MS = 2600;\n\nfunction delayBeforePick(index: number) {\n  if (index === 0) {\n    return FIRST_PICK_MS;\n  }\n  return READ_MS;\n}\n\nexport default function Testimonials01() {\n  const [theme, setTheme] = useState<ThemeChoice>('all');\n  const [message, setMessage] = useState('');\n  const { pressed, press } = usePress<ThemeChoice>();\n\n  const steps = DEMO_THEMES.flatMap((choice, index) => [\n    { after: delayBeforePick(index), run: () => press(choice) },\n    { after: PRESS_LEAD_MS, run: () => setTheme(choice) },\n  ]);\n  const { ref } = useAutoplay<HTMLElement>(steps, {\n    loopAfter: LOOP_AFTER_MS,\n    onReset: () => setTheme('all'),\n  });\n\n  function pick(choice: ThemeChoice) {\n    setTheme(choice);\n    setMessage(spokenLineOf(choice));\n  }\n\n  return (\n    <section ref={ref} className='@container'>\n      <div className='mx-auto flex max-w-6xl flex-col gap-10 px-4 py-16 @2xl:px-6 @2xl:py-24 @5xl:px-8'>\n        <header className='flex max-w-2xl flex-col gap-3'>\n          <p className='text-primary-ink flex items-center gap-1.5 text-[13px] font-medium'>\n            <QuoteIcon className='size-4' />\n            {SECTION.label}\n          </p>\n          <h2 className='text-2xl font-semibold text-balance @2xl:text-3xl'>\n            {SECTION.title}\n          </h2>\n          <p className='text-muted-foreground text-base text-pretty'>\n            {SECTION.lead}\n          </p>\n        </header>\n        <div className='flex flex-col gap-5'>\n          <div className='flex flex-wrap items-center justify-between gap-3'>\n            <ThemePicker value={theme} pressed={pressed} onValueChange={pick} />\n            <Badge variant='secondary'>Sample quotes</Badge>\n          </div>\n          <div className='columns-1 gap-4 *:mb-4 *:break-inside-avoid @xl:columns-2 @4xl:columns-3'>\n            {QUOTES.map((quote) => (\n              <QuoteCard key={quote.id} quote={quote} theme={theme} />\n            ))}\n          </div>\n        </div>\n      </div>\n      <LiveRegion message={message} />\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/testimonials-01/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/testimonials/testimonials-01/theme-picker.tsx",
      "content": "'use client';\n\nimport { pressedQuietOf } from '@/registry/ndeko/lib/demonstration';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { ToggleGroup, ToggleGroupItem } from '@/registry/ndeko/ui/toggle-group';\n\nimport { QUOTES, THEMES, type Theme, type ThemeChoice } from './data';\n\nconst THUMB =\n  'bg-card shadow-[0_1px_2px_rgb(0_0_0/0.08)] hairline-ring ring-foreground/10 dark:bg-foreground/[0.09] dark:ring-foreground/15';\n\ntype Choice = {\n  id: ThemeChoice;\n  label: string;\n  count: number;\n};\n\nfunction countOf(choice: ThemeChoice) {\n  if (choice === 'all') {\n    return QUOTES.length;\n  }\n  const matching = QUOTES.filter((quote) => quote.theme === choice);\n  return matching.length;\n}\n\nfunction choiceOfTheme(theme: Theme): Choice {\n  return { id: theme.id, label: theme.label, count: countOf(theme.id) };\n}\n\nconst ALL_CHOICE: Choice = {\n  id: 'all',\n  label: 'All quotes',\n  count: QUOTES.length,\n};\n\nconst THEME_CHOICES = THEMES.map((theme) => choiceOfTheme(theme));\n\nconst CHOICES: Choice[] = [ALL_CHOICE, ...THEME_CHOICES];\n\nfunction quotesWordOf(count: number) {\n  if (count === 1) {\n    return '1 quote';\n  }\n  return `${count} quotes`;\n}\n\nexport function spokenLineOf(choice: ThemeChoice) {\n  const count = countOf(choice);\n  if (choice === 'all') {\n    return `All ${quotesWordOf(count)}`;\n  }\n  const theme = THEMES.find((candidate) => candidate.id === choice);\n  const subject = theme?.spoken ?? '';\n  return `${quotesWordOf(count)} about ${subject}`;\n}\n\ntype ThemePickerProps = {\n  value: ThemeChoice;\n  pressed: ThemeChoice | null;\n  onValueChange: (choice: ThemeChoice) => void;\n};\n\nexport function ThemePicker({\n  value,\n  pressed,\n  onValueChange,\n}: ThemePickerProps) {\n  const pressedValues = [value];\n\n  /** Pressing the chosen theme again would leave nothing pressed: the choice stays. */\n  function change(nextValues: unknown[]) {\n    const [nextValue] = nextValues;\n    const choice = CHOICES.find((candidate) => candidate.id === nextValue);\n    if (choice) {\n      onValueChange(choice.id);\n    }\n  }\n\n  return (\n    <ToggleGroup\n      aria-label='Show the quotes about'\n      value={pressedValues}\n      onValueChange={change}\n      travel\n      size='sm'\n      indicatorClassName={THUMB}\n      className='bg-foreground/[0.05] flex-wrap rounded-lg p-0.5'\n    >\n      {CHOICES.map((choice) => (\n        <ToggleGroupItem\n          key={choice.id}\n          value={choice.id}\n          className={cn(\n            'h-7 gap-1.5 rounded-md px-2.5 text-xs',\n            pressedQuietOf(pressed === choice.id)\n          )}\n        >\n          {choice.label}\n          <span className='text-muted-foreground tabular-nums'>\n            {choice.count}\n          </span>\n        </ToggleGroupItem>\n      ))}\n    </ToggleGroup>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/testimonials-01/theme-picker.tsx"
    },
    {
      "path": "registry/ndeko/blocks/testimonials/testimonials-01/quote-card.tsx",
      "content": "import { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { BrandTile } from '@/registry/ndeko/ui/brand-tile';\nimport { CompanyMark } from '@/registry/ndeko/ui/company-mark';\n\nimport type { Quote, QuotePart, ThemeChoice } from './data';\n\ntype Emphasis = 'even' | 'marked' | 'quiet';\n\nfunction emphasisOf(quote: Quote, theme: ThemeChoice): Emphasis {\n  if (theme === 'all') {\n    return 'even';\n  }\n  if (quote.theme === theme) {\n    return 'marked';\n  }\n  return 'quiet';\n}\n\nconst TEXT_CLASS: Record<Emphasis, string> = {\n  even: 'text-foreground',\n  marked: 'text-foreground',\n  quiet: 'text-muted-foreground',\n};\n\n/**\n * A flat tint drawn as an image, so its size can grow from the start of the phrase on every line it\n * wraps to. The browser paints a mark yellow by default: its own colour is cleared.\n */\nconst PHRASE =\n  'from-primary/15 to-primary/15 -mx-0.5 rounded-[3px] bg-transparent bg-linear-to-r bg-no-repeat box-decoration-clone px-0.5 font-medium transition-[background-size,color] duration-500 ease-(--ease-out-strong) motion-reduce:transition-colors';\n\nconst PHRASE_CLASS: Record<Emphasis, string> = {\n  even: 'text-primary-ink [background-size:0%_100%]',\n  marked: 'text-primary-ink [background-size:100%_100%]',\n  quiet: 'text-muted-foreground [background-size:0%_100%]',\n};\n\ntype QuotePartViewProps = {\n  part: QuotePart;\n  emphasis: Emphasis;\n};\n\nfunction QuotePartView({ part, emphasis }: QuotePartViewProps) {\n  if (part.kind === 'phrase') {\n    return (\n      <mark className={cn(PHRASE, PHRASE_CLASS[emphasis])}>{part.text}</mark>\n    );\n  }\n  if (part.kind === 'brand') {\n    return (\n      <span className='whitespace-nowrap'>\n        <BrandTile brand={part.brand} size='sm' className='me-1 align-[-3px]' />\n        {part.text}\n      </span>\n    );\n  }\n  return part.text;\n}\n\ntype QuoteCardProps = {\n  quote: Quote;\n  theme: ThemeChoice;\n};\n\nexport function QuoteCard({ quote, theme }: QuoteCardProps) {\n  const emphasis = emphasisOf(quote, theme);\n  const { person } = quote;\n\n  return (\n    <figure className='bg-card hairline-ring ring-border dark:bg-foreground/[0.04] flex flex-col gap-5 rounded-xl p-5 shadow-[0_1px_2px_rgb(0_0_0/0.04)]'>\n      <blockquote\n        className={cn(\n          'text-sm leading-6 text-pretty transition-colors duration-300',\n          TEXT_CLASS[emphasis]\n        )}\n      >\n        <p>\n          {quote.parts.map((part, index) => (\n            <QuotePartView key={index} part={part} emphasis={emphasis} />\n          ))}\n        </p>\n      </blockquote>\n      <figcaption className='flex items-center gap-3'>\n        <Avatar seed={person.name} />\n        <span className='flex min-w-0 flex-1 flex-col'>\n          <span className='truncate text-[13px] font-medium'>\n            {person.name}\n          </span>\n          <span className='text-muted-foreground truncate text-xs'>\n            {person.role}, {person.company}\n          </span>\n        </span>\n        <CompanyMark seed={person.company} />\n      </figcaption>\n    </figure>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/testimonials-01/quote-card.tsx"
    },
    {
      "path": "registry/ndeko/blocks/testimonials/testimonials-01/data.ts",
      "content": "import type { BrandSlug } from '@/registry/ndeko/lib/brand-logos';\n\nexport type ThemeId = 'replies' | 'handoffs' | 'setup';\n\nexport type ThemeChoice = ThemeId | 'all';\n\nexport type Theme = {\n  id: ThemeId;\n  label: string;\n  spoken: string;\n};\n\n/** A quote is written in parts: the phrase is the one its theme lights, a brand part wears its real mark. */\nexport type QuotePart =\n  | { kind: 'text'; text: string }\n  | { kind: 'phrase'; text: string }\n  | { kind: 'brand'; brand: BrandSlug; text: string };\n\nexport type Person = {\n  name: string;\n  role: string;\n  company: string;\n};\n\nexport type Quote = {\n  id: string;\n  theme: ThemeId;\n  parts: QuotePart[];\n  person: Person;\n};\n\nexport const SECTION = {\n  label: 'Customer quotes',\n  title: 'What support teams say after a month on Tidewell',\n  lead: 'Leads and agents on replies that arrive drafted, on fewer handoffs and on a setup that took an afternoon.',\n};\n\nexport const THEMES: Theme[] = [\n  { id: 'replies', label: 'Faster replies', spoken: 'faster replies' },\n  { id: 'handoffs', label: 'Fewer handoffs', spoken: 'fewer handoffs' },\n  { id: 'setup', label: 'Quick setup', spoken: 'a quick setup' },\n];\n\n/** Invented people and companies. The quotes are samples written for this block. */\nexport const QUOTES: Quote[] = [\n  {\n    id: 'mara',\n    theme: 'replies',\n    parts: [\n      {\n        kind: 'text',\n        text: 'By the time I open a ticket the reply is already written, with the order pulled from ',\n      },\n      { kind: 'brand', brand: 'shopify', text: 'Shopify' },\n      {\n        kind: 'text',\n        text: '. Most mornings I read it, change a line and send. ',\n      },\n      {\n        kind: 'phrase',\n        text: 'Our first reply went from hours to minutes',\n      },\n      { kind: 'text', text: ' without anyone working faster.' },\n    ],\n    person: {\n      name: 'Mara Lindqvist',\n      role: 'Head of Support',\n      company: 'Northfold Outdoor',\n    },\n  },\n  {\n    id: 'tomas',\n    theme: 'handoffs',\n    parts: [\n      {\n        kind: 'text',\n        text: 'Refunds used to bounce between three of us. Now the draft already holds the charge from ',\n      },\n      { kind: 'brand', brand: 'stripe', text: 'Stripe' },\n      { kind: 'text', text: ' and the policy line, so ' },\n      { kind: 'phrase', text: 'one person closes it' },\n      { kind: 'text', text: ' from start to finish.' },\n    ],\n    person: {\n      name: 'Tomás Ferreira',\n      role: 'Support engineer',\n      company: 'Parcelwise',\n    },\n  },\n  {\n    id: 'aiko',\n    theme: 'setup',\n    parts: [\n      {\n        kind: 'phrase',\n        text: 'We were answering with it the same afternoon.',\n      },\n      { kind: 'text', text: ' It read our help pages in ' },\n      { kind: 'brand', brand: 'notion', text: 'Notion' },\n      {\n        kind: 'text',\n        text: ' and asked about the two policies it could not find.',\n      },\n    ],\n    person: {\n      name: 'Aiko Tanabe',\n      role: 'Operations lead',\n      company: 'Kettle & Crumb',\n    },\n  },\n  {\n    id: 'daniel',\n    theme: 'replies',\n    parts: [\n      { kind: 'text', text: 'Patients write to us at night. ' },\n      { kind: 'phrase', text: 'The drafts are waiting when we come in' },\n      { kind: 'text', text: ', sorted by what is urgent.' },\n    ],\n    person: {\n      name: 'Daniel Osei',\n      role: 'Support lead',\n      company: 'Lumen Dental Group',\n    },\n  },\n  {\n    id: 'priya',\n    theme: 'handoffs',\n    parts: [\n      {\n        kind: 'text',\n        text: 'Warranty claims come in tagged, with the photos attached and the frame number read off them, so ',\n      },\n      { kind: 'phrase', text: 'nothing waits a day in the wrong queue' },\n      { kind: 'text', text: ' any more.' },\n    ],\n    person: {\n      name: 'Priya Raman',\n      role: 'Customer care manager',\n      company: 'Orbitwheel Bikes',\n    },\n  },\n  {\n    id: 'jonas',\n    theme: 'replies',\n    parts: [\n      { kind: 'text', text: 'I am the support team. ' },\n      { kind: 'phrase', text: 'A forty minute inbox now takes me ten' },\n      { kind: 'text', text: ', and I still sign every reply myself.' },\n    ],\n    person: {\n      name: 'Jonas Weber',\n      role: 'Founder',\n      company: 'Fernhill Studio',\n    },\n  },\n  {\n    id: 'sofia',\n    theme: 'handoffs',\n    parts: [\n      { kind: 'text', text: 'Bugs go straight to ' },\n      { kind: 'brand', brand: 'linear', text: 'Linear' },\n      {\n        kind: 'text',\n        text: ' with the steps the customer took written out. ',\n      },\n      { kind: 'phrase', text: 'Engineering stopped asking us for details' },\n      { kind: 'text', text: ' the week we switched.' },\n    ],\n    person: {\n      name: 'Sofia Marchetti',\n      role: 'Head of Customer Experience',\n      company: 'Brightmoor Insurance',\n    },\n  },\n  {\n    id: 'kwame',\n    theme: 'setup',\n    parts: [\n      { kind: 'text', text: 'There was no training week. ' },\n      { kind: 'phrase', text: 'I learned it by sending my first ten replies' },\n      {\n        kind: 'text',\n        text: ', and the drafts got closer to how I write by the end of the day.',\n      },\n    ],\n    person: {\n      name: 'Kwame Asante',\n      role: 'Support agent',\n      company: 'Saltmarsh Coffee',\n    },\n  },\n  {\n    id: 'elif',\n    theme: 'replies',\n    parts: [\n      { kind: 'text', text: 'On Mondays ' },\n      { kind: 'phrase', text: 'the weekend backlog is gone before lunch' },\n      {\n        kind: 'text',\n        text: ', and the tone still sounds like us because it learned from our old replies.',\n      },\n    ],\n    person: {\n      name: 'Elif Kaya',\n      role: 'Team lead',\n      company: 'Quillstack',\n    },\n  },\n];\n",
      "type": "registry:component",
      "target": "components/blocks/testimonials-01/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "testimonials"
  ],
  "type": "registry:block"
}