{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "team-sections-03",
  "title": "Team showcase",
  "description": "The team as a spotlight over a picker of people: picking someone sends the raised spotlight gliding to them while their profile opens in place on the featured card, with what to ask them about, their links and a button that copies their email address.",
  "dependencies": [
    "@base-ui/react",
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/avatar.json",
    "https://ui.ndekocode.dev/r/badge.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/copy-button.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/motion-presets.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-autoplay.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json",
    "https://ui.ndekocode.dev/r/wash.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-03/index.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useId, useState } from 'react';\n\nimport { useAutoplay } from '@/registry/ndeko/hooks/use-autoplay';\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';\nimport { EASE_OUT_STRONG } from '@/registry/ndeko/lib/motion-presets';\nimport { LiveRegion } from '@/registry/ndeko/ui/live-region';\nimport { Wash } from '@/registry/ndeko/ui/wash';\n\nimport { MEMBERS, SECTION } from './data';\nimport { MemberProfile } from './member-profile';\nimport { PeoplePicker, tabIdOf } from './people-picker';\n\nconst PICK_MS = 3800;\n\nconst ENTER: Transition = { duration: 0.4, ease: EASE_OUT_STRONG };\n\nconst EXIT: Transition = { duration: 0.18, ease: EASE_OUT_STRONG };\n\nconst PROFILE_VARIANTS: Variants = {\n  enter: { opacity: 0, y: 6, filter: 'blur(4px)' },\n  shown: { opacity: 1, y: 0, filter: 'blur(0px)', transition: ENTER },\n  gone: { opacity: 0, filter: 'blur(4px)', transition: EXIT },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  shown: { opacity: 1, transition: ENTER },\n  gone: { opacity: 0, transition: EXIT },\n};\n\nfunction variantsOf(shouldReduceMotion: boolean) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return PROFILE_VARIANTS;\n}\n\nfunction indexAfter(index: number) {\n  const next = index + 1;\n  return next % MEMBERS.length;\n}\n\n/** The next person after each one, so a round ends on the first person and the loop shows no seam. */\nconst ROTATION = MEMBERS.map((_, index) => indexAfter(index));\n\nfunction spokenMemberOf(index: number) {\n  const member = MEMBERS[index];\n  return `Showing ${member.name}, ${member.role} in ${member.location}`;\n}\n\nexport default function TeamSections03() {\n  const [activeIndex, setActiveIndex] = useState(0);\n  const [message, setMessage] = useState('');\n  const { pressed, press } = usePress<string>();\n  const idBase = useId();\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const activeMember = MEMBERS[activeIndex];\n  const panelId = `${idBase}-panel`;\n  const activeTabId = tabIdOf(idBase, activeMember.id);\n  const variants = variantsOf(shouldReduceMotion);\n\n  const steps = ROTATION.flatMap((index) => [\n    { after: PICK_MS, run: () => press(MEMBERS[index].id) },\n    { after: PRESS_LEAD_MS, run: () => setActiveIndex(index) },\n  ]);\n  const { ref } = useAutoplay<HTMLElement>(steps, { loopAfter: 0 });\n\n  function pick(memberId: string) {\n    const index = MEMBERS.findIndex((member) => member.id === memberId);\n    setActiveIndex(index);\n    setMessage(spokenMemberOf(index));\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            <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        <div className='flex flex-col gap-4'>\n          <PeoplePicker\n            members={MEMBERS}\n            activeId={activeMember.id}\n            pressedId={pressed}\n            tabIdBase={idBase}\n            panelId={panelId}\n            onPick={pick}\n          />\n          <div\n            id={panelId}\n            role='tabpanel'\n            aria-labelledby={activeTabId}\n            className='bg-card hairline-ring ring-border dark:bg-foreground/[0.04] relative isolate rounded-2xl p-6 shadow-[0_1px_2px_rgb(0_0_0/0.04)] @2xl:p-8'\n          >\n            <Wash />\n            <div className='grid *:col-start-1 *:row-start-1'>\n              {MEMBERS.map((member) => (\n                <div\n                  key={member.id}\n                  aria-hidden='true'\n                  inert\n                  className='invisible'\n                >\n                  <MemberProfile member={member} />\n                </div>\n              ))}\n              <AnimatePresence initial={false}>\n                <motion.div\n                  key={activeMember.id}\n                  variants={variants}\n                  initial='enter'\n                  animate='shown'\n                  exit='gone'\n                >\n                  <MemberProfile member={activeMember} />\n                </motion.div>\n              </AnimatePresence>\n            </div>\n          </div>\n        </div>\n      </div>\n      <LiveRegion message={message} />\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-03/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-03/people-picker.tsx",
      "content": "'use client';\n\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { pressedQuietOf } from '@/registry/ndeko/lib/demonstration';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\n\nimport type { Member } from './data';\n\nexport function tabIdOf(base: string, memberId: string) {\n  return `${base}-tab-${memberId}`;\n}\n\nconst SPOTLIGHT =\n  'bg-card hairline-ring ring-border dark:bg-foreground/[0.07] pointer-events-none absolute top-0 left-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) translate-y-(--active-tab-top) rounded-xl shadow-[0_1px_2px_rgb(0_0_0/0.06),0_4px_12px_-4px_rgb(0_0_0/0.08)]';\n\nfunction travelOf(shouldReduceMotion: boolean) {\n  if (shouldReduceMotion) {\n    return 'transition-none';\n  }\n  return 'transition-[translate,width,height] duration-300 ease-(--ease-out-strong)';\n}\n\nfunction isMemberId(value: unknown, members: readonly Member[]) {\n  return members.some((member) => member.id === value);\n}\n\ntype PeoplePickerProps = {\n  members: readonly Member[];\n  activeId: string;\n  pressedId: string | null;\n  tabIdBase: string;\n  panelId: string;\n  onPick: (memberId: string) => void;\n};\n\nexport function PeoplePicker({\n  members,\n  activeId,\n  pressedId,\n  tabIdBase,\n  panelId,\n  onPick,\n}: PeoplePickerProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n\n  function pickTab(value: unknown) {\n    if (isMemberId(value, members)) {\n      onPick(String(value));\n    }\n  }\n\n  return (\n    <TabsPrimitive.Root value={activeId} onValueChange={pickTab}>\n      <TabsPrimitive.List\n        activateOnFocus\n        aria-label='Pick a person'\n        className='relative isolate flex flex-wrap gap-1'\n      >\n        {members.map((member) => (\n          <TabsPrimitive.Tab\n            key={member.id}\n            value={member.id}\n            id={tabIdOf(tabIdBase, member.id)}\n            aria-controls={panelId}\n            aria-label={`${member.name}, ${member.role}`}\n            className={cn(\n              'group/person hover:bg-foreground/[0.03] focus-visible:ring-ring/25 flex min-w-0 cursor-pointer items-center gap-3 rounded-xl p-2 text-start transition-[background-color,scale] duration-150 ease-(--ease-out-strong) outline-none focus-visible:ring-[3px] data-active:hover:bg-transparent @3xl:pe-4',\n              pressedQuietOf(pressedId === member.id)\n            )}\n          >\n            <Avatar seed={member.name} className='size-10' />\n            <span className='hidden min-w-0 flex-col @3xl:flex'>\n              <span className='text-muted-foreground group-data-active/person:text-foreground truncate text-[13px] font-medium transition-colors duration-150'>\n                {member.name}\n              </span>\n              <span className='text-muted-foreground hidden truncate text-xs @5xl:block'>\n                {member.role}\n              </span>\n            </span>\n          </TabsPrimitive.Tab>\n        ))}\n        <TabsPrimitive.Indicator\n          className={cn('-z-10', SPOTLIGHT, travelOf(shouldReduceMotion))}\n        />\n      </TabsPrimitive.List>\n    </TabsPrimitive.Root>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-03/people-picker.tsx"
    },
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-03/member-profile.tsx",
      "content": "import {\n  GithubIcon,\n  LinkedinBrandIcon,\n  MailIcon,\n  MapPinIcon,\n  TwitterXIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { Badge } from '@/registry/ndeko/ui/badge';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { CopyButton } from '@/registry/ndeko/ui/copy-button';\n\nimport type { Member, SocialKind } from './data';\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\nexport function MemberProfile({ member }: { member: Member }) {\n  return (\n    <article className='grid gap-6 @2xl:grid-cols-[auto_minmax(0,1fr)] @2xl:gap-8'>\n      <Avatar seed={member.name} className='size-20 rounded-2xl @2xl:size-32' />\n      <div className='flex min-w-0 flex-col gap-5'>\n        <header className='flex flex-col gap-1'>\n          <h3 className='text-xl font-semibold text-balance'>{member.name}</h3>\n          <p className='text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1 text-sm'>\n            {member.role}\n            <span aria-hidden='true'>·</span>\n            <span className='inline-flex items-center gap-1'>\n              <MapPinIcon className='size-3.5' />\n              {member.location}\n            </span>\n          </p>\n        </header>\n        <p className='text-sm leading-6 text-pretty'>{member.bio}</p>\n        <div className='flex flex-col gap-2'>\n          <p className='text-muted-foreground text-xs'>Ask me about</p>\n          <ul className='flex flex-wrap gap-1.5'>\n            {member.topics.map((topic) => (\n              <li key={topic}>\n                <Badge variant='secondary'>{topic}</Badge>\n              </li>\n            ))}\n          </ul>\n        </div>\n        <div className='flex flex-wrap items-center gap-x-4 gap-y-2'>\n          <span className='bg-foreground/[0.04] flex min-w-0 items-center gap-2 rounded-lg py-1 ps-2.5 pe-1'>\n            <MailIcon className='text-muted-foreground size-4 shrink-0' />\n            <span className='truncate text-[13px]'>{member.email}</span>\n            <CopyButton\n              text={member.email}\n              label={`Copy the email address of ${member.name}`}\n            />\n          </span>\n          <ul className='-mx-1.5 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        </div>\n      </div>\n    </article>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-03/member-profile.tsx"
    },
    {
      "path": "registry/ndeko/blocks/team-sections/team-sections-03/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  email: string;\n  bio: string;\n  topics: string[];\n  socials: Social[];\n};\n\nexport const SECTION = {\n  label: 'Team',\n  title: 'Meet the people who answer when a clinic writes in',\n  lead: 'Five of us build Sundial and every one of us reads support. Pick someone to see what to ask them about.',\n};\n\n/** Invented people. The addresses use a domain reserved for examples, so nothing is ever sent. */\nexport const MEMBERS: Member[] = [\n  {\n    id: 'amelia',\n    name: 'Amelia Hart',\n    role: 'Founder',\n    location: 'London',\n    email: 'amelia@sundial.example',\n    bio: 'Amelia ran the front desk of a physiotherapy clinic for five years and built the first version of Sundial in its back office. She still spends one day a month on a clinic front desk, watching how people really book.',\n    topics: ['Pricing', 'Partnerships', 'Clinic workflows'],\n    socials: [\n      { kind: 'linkedin', href: '#' },\n      { kind: 'x', href: '#' },\n    ],\n  },\n  {\n    id: 'tunde',\n    name: 'Tunde Bakare',\n    role: 'Engineering lead',\n    location: 'Lagos',\n    email: 'tunde@sundial.example',\n    bio: 'Tunde leads the engineers who keep calendars in sync across every booking channel. He has a rule that no reminder goes out without a test that sends it to his own phone first.',\n    topics: ['Calendar sync', 'Uptime', 'Joining the team'],\n    socials: [\n      { kind: 'github', href: '#' },\n      { kind: 'linkedin', href: '#' },\n    ],\n  },\n  {\n    id: 'ingrid',\n    name: 'Ingrid Solberg',\n    role: 'Product designer',\n    location: 'Oslo',\n    email: 'ingrid@sundial.example',\n    bio: 'Ingrid designs the booking flow patients see on their phones. She tests it with people over seventy every quarter, and every change she ships has to work with a screen reader before it works with a mouse.',\n    topics: ['Booking flow', 'Accessibility', 'Research sessions'],\n    socials: [{ kind: 'linkedin', href: '#' }],\n  },\n  {\n    id: 'rahul',\n    name: 'Rahul Varma',\n    role: 'Data engineer',\n    location: 'Pune',\n    email: 'rahul@sundial.example',\n    bio: 'Rahul builds the forecasts that warn a clinic about likely no-shows a day ahead. Patient data never leaves the region it was collected in, and he wrote the export that lets a clinic take all of it with them.',\n    topics: ['No-show forecasts', 'Data exports', 'Privacy'],\n    socials: [\n      { kind: 'github', href: '#' },\n      { kind: 'x', href: '#' },\n    ],\n  },\n  {\n    id: 'chloe',\n    name: 'Chloé Mwamba',\n    role: 'Customer lead',\n    location: 'Kinshasa',\n    email: 'chloe@sundial.example',\n    bio: 'Chloé sets up every new clinic and trains their front desk, in French, English or Lingala. The feature requests she brings back from those sessions decide a good part of what the team builds next.',\n    topics: ['Onboarding', 'Training', 'Feature requests'],\n    socials: [{ kind: 'linkedin', href: '#' }],\n  },\n];\n",
      "type": "registry:component",
      "target": "components/blocks/team-sections-03/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "team-sections"
  ],
  "type": "registry:block"
}