{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "team-sections-01",
  "title": "Team grid",
  "description": "The people behind a product as cards with their drawn picture, role, city, a bio clamped to three lines and labelled social links, beside a dashed seat for the open role: Read more opens a bio in place, the card growing to fit it while its label rolls to Show less.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/animated-size.json",
    "https://ui.ndekocode.dev/r/avatar.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/demonstration.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/motion-word-roll.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-autoplay.json",
    "https://ui.ndekocode.dev/r/use-kept-height.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-01/index.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { useAutoplay } from '@/registry/ndeko/hooks/use-autoplay';\nimport { useKeptHeight } from '@/registry/ndeko/hooks/use-kept-height';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { PRESS_LEAD_MS, usePress } from '@/registry/ndeko/lib/demonstration';\nimport { UsersIcon } from '@/registry/ndeko/lib/icons';\n\nimport { MEMBERS, SECTION } from './data';\nimport { MemberCard } from './member-card';\nimport { OpeningCard } from './opening-card';\n\n/** From two columns on, this card sits in the last row, so opening its bio moves no other card. */\nconst SHOWN_ID = 'mei';\n\nconst RESTING_OPEN = [SHOWN_ID];\n\nconst NONE_OPEN: string[] = [];\n\n/** `null` until someone opens a bio: closed while the demonstration plays, one open under reduced motion. */\ntype OpenIds = string[] | null;\n\nfunction openIdsOf(state: OpenIds, shouldReduceMotion: boolean) {\n  if (state !== null) {\n    return state;\n  }\n  if (shouldReduceMotion) {\n    return RESTING_OPEN;\n  }\n  return NONE_OPEN;\n}\n\nfunction withToggled(ids: readonly string[], id: string, isOpen: boolean) {\n  const others = ids.filter((candidate) => candidate !== id);\n  if (isOpen) {\n    return [...others, id];\n  }\n  return others;\n}\n\nexport default function TeamSections01() {\n  const [state, setState] = useState<OpenIds>(null);\n  const { pressed, press } = usePress<string>();\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const openIds = openIdsOf(state, shouldReduceMotion);\n\n  function setOpen(id: string, isOpen: boolean) {\n    const next = withToggled(openIds, id, isOpen);\n    setState(next);\n  }\n\n  function toggle(id: string) {\n    const isOpen = openIds.includes(id);\n    setOpen(id, !isOpen);\n  }\n\n  const steps = [\n    { after: 2600, run: () => press(SHOWN_ID) },\n    { after: PRESS_LEAD_MS, run: () => setOpen(SHOWN_ID, true) },\n    { after: 4200, run: () => press(SHOWN_ID) },\n    { after: PRESS_LEAD_MS, run: () => setOpen(SHOWN_ID, false) },\n  ];\n  const { ref } = useAutoplay<HTMLElement>(steps, {\n    loopAfter: 2400,\n    onReset: () => setState(null),\n  });\n  useKeptHeight(ref);\n\n  return (\n    <section ref={ref} className='@container min-h-[61rem]'>\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            <UsersIcon 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        <ul className='grid items-start gap-3 @xl:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4'>\n          {MEMBERS.map((member) => (\n            <li key={member.id}>\n              <MemberCard\n                member={member}\n                isOpen={openIds.includes(member.id)}\n                isPressed={pressed === member.id}\n                onToggle={toggle}\n              />\n            </li>\n          ))}\n          <li>\n            <OpeningCard />\n          </li>\n        </ul>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-01/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-01/member-card.tsx",
      "content": "import {\n  GithubIcon,\n  LinkedinBrandIcon,\n  MapPinIcon,\n  TwitterXIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport type { Member, SocialKind } from './data';\nimport { MemberBio } from './member-bio';\n\nconst SOCIAL_ICONS: Record<SocialKind, Icon> = {\n  linkedin: LinkedinBrandIcon,\n  x: TwitterXIcon,\n  github: GithubIcon,\n};\n\nconst SOCIAL_NAMES: Record<SocialKind, string> = {\n  linkedin: 'LinkedIn',\n  x: 'X',\n  github: 'GitHub',\n};\n\ntype MemberCardProps = {\n  member: Member;\n  isOpen: boolean;\n  isPressed: boolean;\n  onToggle: (memberId: string) => void;\n};\n\nexport function MemberCard({\n  member,\n  isOpen,\n  isPressed,\n  onToggle,\n}: MemberCardProps) {\n  return (\n    <article className='bg-card hairline-ring ring-border dark:bg-foreground/[0.04] flex h-full flex-col gap-4 rounded-xl p-5 shadow-[0_1px_2px_rgb(0_0_0/0.04)]'>\n      <header className='flex items-start gap-3'>\n        <Avatar seed={member.name} className='size-12' />\n        <div className='flex min-w-0 flex-col gap-0.5'>\n          <h3 className='truncate text-sm font-medium'>{member.name}</h3>\n          <p className='text-muted-foreground truncate text-[13px]'>\n            {member.role}\n          </p>\n          <p className='text-muted-foreground flex min-w-0 items-center gap-1 text-xs'>\n            <MapPinIcon className='size-3.5 shrink-0' />\n            <span className='truncate'>{member.location}</span>\n          </p>\n        </div>\n      </header>\n      <MemberBio\n        name={member.name}\n        bio={member.bio}\n        isOpen={isOpen}\n        isPressed={isPressed}\n        onToggle={() => onToggle(member.id)}\n      />\n      <ul className='-mx-1.5 mt-auto flex items-center gap-0.5'>\n        {member.socials.map((social) => {\n          const Glyph = SOCIAL_ICONS[social.kind];\n          const label = `${member.name} on ${SOCIAL_NAMES[social.kind]}`;\n\n          return (\n            <li key={social.kind}>\n              <Button\n                variant='ghost'\n                size='icon-sm'\n                nativeButton={false}\n                aria-label={label}\n                render={<a href={social.href} />}\n                className='text-muted-foreground'\n              >\n                <Glyph />\n              </Button>\n            </li>\n          );\n        })}\n      </ul>\n    </article>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-01/member-card.tsx"
    },
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-01/member-bio.tsx",
      "content": "'use client';\n\nimport {\n  useEffect,\n  useEffectEvent,\n  useId,\n  useRef,\n  useState,\n  type RefObject,\n} from 'react';\n\nimport { WordRoll } from '@/components/core/word-roll';\nimport { pressedQuietOf } from '@/registry/ndeko/lib/demonstration';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nconst TOGGLE_LABELS = ['Read more', 'Show less'];\n\nfunction toggleLabelOf(isOpen: boolean) {\n  if (isOpen) {\n    return 'Show less';\n  }\n  return 'Read more';\n}\n\nfunction clampOf(isOpen: boolean) {\n  if (isOpen) {\n    return 'line-clamp-none';\n  }\n  return 'line-clamp-3';\n}\n\n/**\n * Read more shows only when the clamp hides something, measured again at every width. While the\n * bio is open there is nothing to measure, so the last answer stands.\n */\nfunction useCanExpand(\n  textRef: RefObject<HTMLParagraphElement | null>,\n  isOpen: boolean\n) {\n  const [canExpand, setCanExpand] = useState(true);\n\n  const measure = useEffectEvent(() => {\n    const text = textRef.current;\n    if (!text || isOpen) {\n      return;\n    }\n    const isCut = text.scrollHeight > text.clientHeight;\n    setCanExpand(isCut);\n  });\n\n  useEffect(() => {\n    const text = textRef.current;\n    if (!text) {\n      return;\n    }\n    const observer = new ResizeObserver(() => measure());\n    observer.observe(text);\n    return () => observer.disconnect();\n  }, [textRef]);\n\n  return canExpand;\n}\n\ntype MemberBioProps = {\n  name: string;\n  bio: string;\n  isOpen: boolean;\n  isPressed: boolean;\n  onToggle: () => void;\n};\n\nexport function MemberBio({\n  name,\n  bio,\n  isOpen,\n  isPressed,\n  onToggle,\n}: MemberBioProps) {\n  const bioId = useId();\n  const textRef = useRef<HTMLParagraphElement>(null);\n  const canExpand = useCanExpand(textRef, isOpen);\n  const showsToggle = canExpand || isOpen;\n\n  return (\n    <div className='flex flex-col items-start gap-1'>\n      <AnimatedSize className='w-full'>\n        <p\n          ref={textRef}\n          id={bioId}\n          className={cn(\n            'text-muted-foreground text-[13px] leading-5 text-pretty',\n            clampOf(isOpen)\n          )}\n        >\n          {bio}\n        </p>\n      </AnimatedSize>\n      {showsToggle && (\n        <Button\n          type='button'\n          variant='link'\n          size='sm'\n          aria-expanded={isOpen}\n          aria-controls={bioId}\n          onClick={onToggle}\n          className={cn(\n            '-mx-1 h-6 px-1 text-[13px]',\n            pressedQuietOf(isPressed)\n          )}\n        >\n          <WordRoll text={toggleLabelOf(isOpen)} labels={TOGGLE_LABELS} />\n          <span className='sr-only'> about {name}</span>\n        </Button>\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-01/member-bio.tsx"
    },
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-01/opening-card.tsx",
      "content": "import { ArrowRightIcon, UserRoundPlusIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { OPENING } from './data';\n\n/** A seat nobody holds yet: the dashed slot is the one place in the grid that invites an addition. */\nexport function OpeningCard() {\n  return (\n    <article className='hairline-border border-foreground/20 flex h-full flex-col items-start gap-4 rounded-xl border-dashed p-5'>\n      <span className='keycap-3d text-muted-foreground flex size-12 items-center justify-center rounded-full'>\n        <UserRoundPlusIcon />\n      </span>\n      <div className='flex flex-col gap-1'>\n        <h3 className='text-sm font-medium'>{OPENING.title}</h3>\n        <p className='text-muted-foreground text-[13px] leading-5 text-pretty'>\n          {OPENING.text}\n        </p>\n      </div>\n      <Button\n        variant='outline'\n        size='sm'\n        nativeButton={false}\n        render={<a href={OPENING.href} />}\n        className='mt-auto'\n      >\n        {OPENING.linkLabel}\n        <ArrowRightIcon />\n      </Button>\n    </article>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-01/opening-card.tsx"
    },
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-01/data.ts",
      "content": "export type SocialKind = 'linkedin' | 'x' | 'github';\n\nexport type Social = {\n  kind: SocialKind;\n  href: string;\n};\n\nexport type Member = {\n  id: string;\n  name: string;\n  role: string;\n  location: string;\n  bio: string;\n  socials: Social[];\n};\n\nexport const SECTION = {\n  label: 'Team',\n  title: 'The people behind Ledgerline',\n  lead: 'Accountants, engineers and designers in seven cities. Everyone answers support one morning a week.',\n};\n\nexport const OPENING = {\n  title: 'Your name here',\n  text: 'We are hiring a support engineer, in Lisbon or remote.',\n  linkLabel: 'See open roles',\n  href: '#',\n};\n\n/** Invented people. */\nexport const MEMBERS: Member[] = [\n  {\n    id: 'clara',\n    name: 'Clara Nyström',\n    role: 'Co-founder and CEO',\n    location: 'Stockholm',\n    bio: 'Clara spent eight years closing the books at a shipping company before she started Ledgerline. She still reconciles one real account by hand every month to see where the product gets it wrong, and she reads every support message with the word refund in it. Outside work she rows on Lake Mälaren.',\n    socials: [\n      { kind: 'linkedin', href: '#' },\n      { kind: 'x', href: '#' },\n    ],\n  },\n  {\n    id: 'kofi',\n    name: 'Kofi Mensah',\n    role: 'Co-founder and CTO',\n    location: 'Accra',\n    bio: 'Kofi built payment systems for mobile money before Ledgerline, which is why every amount in the product is stored in minor units and every rounding rule has a test with a name. He leads engineering, reviews the migrations himself and keeps a list of the bugs that taught him something.',\n    socials: [\n      { kind: 'linkedin', href: '#' },\n      { kind: 'github', href: '#' },\n      { kind: 'x', href: '#' },\n    ],\n  },\n  {\n    id: 'lea',\n    name: 'Lea Fischer',\n    role: 'Design lead',\n    location: 'Berlin',\n    bio: 'Lea designs the reconciliation screens, the part of the product people look at for hours at month end. She tests every change with three accountants before it ships and keeps a folder of the spreadsheets customers sent her, which she calls the real design system.',\n    socials: [{ kind: 'linkedin', href: '#' }],\n  },\n  {\n    id: 'arjun',\n    name: 'Arjun Mehta',\n    role: 'Machine learning engineer',\n    location: 'Bengaluru',\n    bio: 'Arjun trains the models that match bank lines to invoices. He measures them on the books of customers who agreed to share them, never on made-up data, and writes the release note of every model change in plain words an accountant can check.',\n    socials: [\n      { kind: 'github', href: '#' },\n      { kind: 'linkedin', href: '#' },\n    ],\n  },\n  {\n    id: 'sofia',\n    name: 'Sofía Paredes',\n    role: 'Head of Customer Success',\n    location: 'Mexico City',\n    bio: 'Sofía moves every new customer from spreadsheets to Ledgerline, usually within a week. She has moved the books of a ferry company, two breweries and a chain of dental clinics, and turns the questions people ask during that week into the guides of the help center.',\n    socials: [\n      { kind: 'linkedin', href: '#' },\n      { kind: 'x', href: '#' },\n    ],\n  },\n  {\n    id: 'patrick',\n    name: 'Patrick Ilunga',\n    role: 'Infrastructure engineer',\n    location: 'Kinshasa',\n    bio: 'Patrick keeps Ledgerline running at month end, when traffic triples in two days. He wrote the runbooks the whole team follows during an incident, and he is the reason every backup is restored once a week on a machine nobody uses, just to prove that it works.',\n    socials: [{ kind: 'github', href: '#' }],\n  },\n  {\n    id: 'mei',\n    name: 'Mei Lin',\n    role: 'Accountant in residence',\n    location: 'Singapore',\n    bio: 'Mei is a chartered accountant who works inside the product team. She checks every rule the product learns against how accountants really close a month, writes the test cases for the tax rules of eleven countries and says no more often than anyone else here.',\n    socials: [{ kind: 'linkedin', href: '#' }],\n  },\n];\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-01/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "team-sections"
  ],
  "type": "registry:block"
}