{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "aside-02",
  "title": "Member profile",
  "description": "Presence on the avatar, contact rows, the day split by project in one bar that morphs between today and yesterday",
  "dependencies": [
    "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/chip.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/sheet.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/toggle-group.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/components/aside/aside-02.tsx",
      "content": "'use client';\n\nimport { motion } from 'motion/react';\nimport { useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport {\n  ArrowUpRightIcon,\n  FileSpreadsheetIcon,\n  FileTextIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { Badge, type BadgeProps } from '@/registry/ndeko/ui/badge';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Chip } from '@/registry/ndeko/ui/chip';\nimport { ToggleGroup, ToggleGroupItem } from '@/registry/ndeko/ui/toggle-group';\n\nimport {\n  AsideCloseButton,\n  AsideDescription,\n  AsidePreview,\n  AsideTitle,\n} from './_parts/aside-frame';\nimport { CopyIconButton } from './_parts/copy-icon-button';\nimport { travelOf } from './_parts/motion';\nimport { PEOPLE } from './_parts/people';\nimport { PersonAvatar } from './_parts/person-avatar';\nimport { IssueTypeGem, STATUS_META } from './_parts/task-meta';\n\ntype Day = 'today' | 'yesterday';\n\ntype ProjectTime = { id: string; name: string; color: string; minutes: number };\n\ntype Note = {\n  id: string;\n  authorId: string;\n  isPrivate: boolean;\n  date: string;\n  text: string;\n};\n\ntype MemberFile = { id: string; name: string; size: string; icon: Icon };\n\nconst MEMBER = PEOPLE[2];\n\nconst PROJECT_COLORS = {\n  atlas: 'var(--primary)',\n  billing: 'var(--info)',\n  support: 'var(--warning)',\n  reviews: 'var(--success)',\n};\n\nconst TIME_BY_DAY: Record<Day, ProjectTime[]> = {\n  today: [\n    {\n      id: 'atlas',\n      name: 'Atlas redesign',\n      color: PROJECT_COLORS.atlas,\n      minutes: 150,\n    },\n    {\n      id: 'billing',\n      name: 'Billing API',\n      color: PROJECT_COLORS.billing,\n      minutes: 95,\n    },\n    {\n      id: 'support',\n      name: 'Support',\n      color: PROJECT_COLORS.support,\n      minutes: 40,\n    },\n    {\n      id: 'reviews',\n      name: 'Code reviews',\n      color: PROJECT_COLORS.reviews,\n      minutes: 25,\n    },\n  ],\n  yesterday: [\n    {\n      id: 'atlas',\n      name: 'Atlas redesign',\n      color: PROJECT_COLORS.atlas,\n      minutes: 75,\n    },\n    {\n      id: 'billing',\n      name: 'Billing API',\n      color: PROJECT_COLORS.billing,\n      minutes: 230,\n    },\n    {\n      id: 'support',\n      name: 'Support',\n      color: PROJECT_COLORS.support,\n      minutes: 60,\n    },\n    {\n      id: 'reviews',\n      name: 'Code reviews',\n      color: PROJECT_COLORS.reviews,\n      minutes: 45,\n    },\n  ],\n};\n\nconst NOTES: Note[] = [\n  {\n    id: 'note-1',\n    authorId: 'lucas',\n    isPrivate: true,\n    date: 'Oct 28',\n    text: 'Wants to lead the accessibility review next quarter.',\n  },\n  {\n    id: 'note-2',\n    authorId: 'hana',\n    isPrivate: false,\n    date: 'Oct 14',\n    text: 'Owns the date picker and the chart components.',\n  },\n];\n\nconst FILES: MemberFile[] = [\n  {\n    id: 'file-1',\n    name: 'Onboarding plan.pdf',\n    size: '1.4 MB',\n    icon: FileTextIcon,\n  },\n  {\n    id: 'file-2',\n    name: 'Time off 2026.csv',\n    size: '12 KB',\n    icon: FileSpreadsheetIcon,\n  },\n];\n\nfunction isDay(value: string | undefined): value is Day {\n  const isToday = value === 'today';\n  const isYesterday = value === 'yesterday';\n  return isToday || isYesterday;\n}\n\nfunction durationOf(minutes: number) {\n  const hours = Math.floor(minutes / 60);\n  const rest = minutes % 60;\n  const paddedRest = String(rest).padStart(2, '0');\n  return `${hours}h ${paddedRest}m`;\n}\n\nfunction percentText(value: number) {\n  return `${value}%`;\n}\n\nfunction totalOf(projects: ProjectTime[]) {\n  let total = 0;\n  for (const project of projects) {\n    total += project.minutes;\n  }\n  return total;\n}\n\nfunction shareOf(minutes: number, total: number) {\n  const share = (minutes * 100) / total;\n  return Math.round(share);\n}\n\ntype NoteBadge = {\n  label: string;\n  variant: BadgeProps['variant'];\n  className?: string;\n};\n\nfunction noteBadgeOf(isPrivate: boolean): NoteBadge {\n  if (isPrivate) {\n    return {\n      label: 'Private',\n      variant: 'secondary',\n      className: 'text-muted-foreground',\n    };\n  }\n  return { label: 'Team', variant: 'info' };\n}\n\nfunction DetailRow({\n  label,\n  children,\n}: {\n  label: string;\n  children: React.ReactNode;\n}) {\n  return (\n    <div className='grid min-h-8 grid-cols-[5.5rem_1fr] items-center gap-2 text-[13px]'>\n      <span className='text-muted-foreground'>{label}</span>\n      <div className='flex min-w-0 items-center gap-1'>{children}</div>\n    </div>\n  );\n}\n\nfunction DayTime() {\n  const [day, setDay] = useState<Day>('today');\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const transition = travelOf(shouldReduceMotion);\n  const projects = TIME_BY_DAY[day];\n  const total = totalOf(projects);\n\n  function changeDay(values: string[]) {\n    const [nextDay] = values;\n    if (isDay(nextDay)) {\n      setDay(nextDay);\n    }\n  }\n\n  return (\n    <section aria-label='Time by project' className='flex flex-col gap-3'>\n      <div className='flex items-center gap-2'>\n        <h3 className='text-sm font-medium'>Time</h3>\n        <span className='text-muted-foreground text-xs tabular-nums'>\n          {durationOf(total)}\n        </span>\n        <ToggleGroup\n          value={[day]}\n          onValueChange={changeDay}\n          travel\n          size='sm'\n          aria-label='Day'\n          className='bg-foreground/[0.05] ml-auto rounded-lg p-0.5'\n          indicatorClassName='bg-card shadow-[0_1px_2px_rgb(0_0_0/0.08)] hairline-ring ring-foreground/10 dark:bg-foreground/[0.09]'\n        >\n          <ToggleGroupItem value='today' className='h-6 px-2 text-xs'>\n            Today\n          </ToggleGroupItem>\n          <ToggleGroupItem value='yesterday' className='h-6 px-2 text-xs'>\n            Yesterday\n          </ToggleGroupItem>\n        </ToggleGroup>\n      </div>\n      <div aria-hidden='true' className='flex h-2.5 w-full gap-0.5'>\n        {projects.map((project) => {\n          const segmentStyle = {\n            flexGrow: project.minutes,\n            backgroundColor: project.color,\n            borderRadius: 3,\n          };\n\n          return (\n            <motion.span\n              key={project.id}\n              layout\n              transition={transition}\n              style={segmentStyle}\n              className='block h-full basis-0'\n            />\n          );\n        })}\n      </div>\n      <ul className='flex flex-col gap-1.5'>\n        {projects.map((project) => {\n          const swatchStyle = { backgroundColor: project.color };\n          const share = shareOf(project.minutes, total);\n\n          return (\n            <li key={project.id} className='flex items-center gap-2 text-xs'>\n              <span\n                aria-hidden='true'\n                style={swatchStyle}\n                className='size-2 shrink-0 rounded-[3px]'\n              />\n              <span className='min-w-0 flex-1 truncate'>{project.name}</span>\n              <span className='text-muted-foreground tabular-nums'>\n                {durationOf(project.minutes)}\n              </span>\n              <span className='w-9 text-right font-medium tabular-nums'>\n                {percentText(share)}\n              </span>\n            </li>\n          );\n        })}\n      </ul>\n    </section>\n  );\n}\n\nfunction MemberProfile() {\n  const status = STATUS_META['in-review'];\n  const statusStyle = { '--chip': status.color } as React.CSSProperties;\n  const StatusGlyph = status.icon;\n\n  return (\n    <div className='flex flex-col gap-6 p-5'>\n      <div className='flex items-start gap-3'>\n        <PersonAvatar person={MEMBER} size='lg' presence={MEMBER.presence} />\n        <div className='flex min-w-0 flex-1 flex-col gap-1'>\n          <AsideTitle>{MEMBER.name}</AsideTitle>\n          <AsideDescription className='flex items-center gap-1.5'>\n            {MEMBER.title}\n            <Chip color='var(--success)'>Manager</Chip>\n          </AsideDescription>\n        </div>\n        <AsideCloseButton label='Close profile' className='-mt-1 -mr-2' />\n      </div>\n      <div className='flex flex-col gap-0.5'>\n        <DetailRow label='E-mail'>\n          <span className='truncate'>{MEMBER.email}</span>\n          <CopyIconButton\n            text={MEMBER.email}\n            label={`Copy ${MEMBER.email}`}\n            announcement='E-mail address copied'\n          />\n        </DetailRow>\n        <DetailRow label='Local time'>\n          <span className='tabular-nums'>16:20</span>\n          <span className='text-muted-foreground text-xs'>\n            UTC+1, 1 h ahead of you\n          </span>\n        </DetailRow>\n        <DetailRow label='Teams'>\n          <Badge variant='secondary' className='text-muted-foreground'>\n            Product\n          </Badge>\n          <Badge variant='secondary' className='text-muted-foreground'>\n            Platform\n          </Badge>\n        </DetailRow>\n      </div>\n      <DayTime />\n      <section aria-label='Current task' className='flex flex-col gap-2'>\n        <h3 className='text-sm font-medium'>Working on</h3>\n        <div className='bg-foreground/[0.03] flex flex-col gap-1.5 rounded-xl px-3.5 py-3'>\n          <p className='text-muted-foreground flex items-center gap-1.5 text-xs'>\n            <IssueTypeGem type='story' />\n            <span className='tabular-nums'>LAT-136</span>\n            <span\n              style={statusStyle}\n              className='chip-3d ml-auto inline-flex h-5 items-center gap-1 rounded-md px-1.5 font-medium'\n            >\n              <StatusGlyph className='size-3' strokeWidth={2.25} />\n              {status.label}\n            </span>\n          </p>\n          <p className='text-[13px] font-medium'>\n            Chart the hours of the week as day bars\n          </p>\n          <p className='text-muted-foreground text-xs tabular-nums'>\n            1h 20m today, 3h 30m in total\n          </p>\n        </div>\n      </section>\n      <section aria-label='Notes' className='flex flex-col gap-3'>\n        <h3 className='text-sm font-medium'>Notes</h3>\n        <ul className='flex flex-col gap-3'>\n          {NOTES.map((note) => {\n            const author = PEOPLE.find((person) => person.id === note.authorId);\n            const badge = noteBadgeOf(note.isPrivate);\n\n            return (\n              <li key={note.id} className='flex flex-col gap-1'>\n                <p className='flex items-center gap-1.5 text-xs'>\n                  <span className='font-medium'>{author?.name}</span>\n                  <Badge variant={badge.variant} className={badge.className}>\n                    {badge.label}\n                  </Badge>\n                  <span className='text-muted-foreground ml-auto'>\n                    {note.date}\n                  </span>\n                </p>\n                <p className='text-[13px] leading-5'>{note.text}</p>\n              </li>\n            );\n          })}\n        </ul>\n      </section>\n      <section aria-label='Files' className='flex flex-col gap-2'>\n        <h3 className='text-sm font-medium'>Files</h3>\n        <ul className='flex flex-col gap-2'>\n          {FILES.map((file) => {\n            const FileGlyph = file.icon;\n\n            return (\n              <li key={file.id} className='flex items-center gap-2.5'>\n                <span className='keycap-3d text-muted-foreground flex size-8 shrink-0 items-center justify-center rounded-lg'>\n                  <FileGlyph className='size-4' />\n                </span>\n                <span className='flex min-w-0 flex-col'>\n                  <span className='truncate text-[13px] font-medium'>\n                    {file.name}\n                  </span>\n                  <span className='text-muted-foreground text-xs'>\n                    {file.size}\n                  </span>\n                </span>\n              </li>\n            );\n          })}\n        </ul>\n      </section>\n      <Button\n        variant='outline'\n        render={<a href='#' />}\n        nativeButton={false}\n        className='self-start'\n      >\n        Open full profile\n        <ArrowUpRightIcon />\n      </Button>\n    </div>\n  );\n}\n\nexport default function Aside02() {\n  return (\n    <AsidePreview triggerLabel='Open member profile'>\n      <MemberProfile />\n    </AsidePreview>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/aside/aside-02.tsx"
    },
    {
      "path": "registry/ndeko/components/aside/_parts/aside-frame.tsx",
      "content": "'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport { PanelsTopLeftIcon, XIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  Sheet,\n  SheetClose,\n  SheetContent,\n  SheetDescription,\n  SheetTitle,\n  SheetTrigger,\n} from '@/registry/ndeko/ui/sheet';\n\n/** Where an aside's content is drawn: open in the page as a preview, or inside the real sheet. */\nexport type AsideHost = 'preview' | 'sheet';\n\nconst AsideHostContext = createContext<AsideHost>('preview');\n\nexport function useAsideHost() {\n  return useContext(AsideHostContext);\n}\n\nexport type AsideSide = 'left' | 'right';\n\nconst TITLE = 'text-lg leading-tight font-semibold';\n\nconst DESCRIPTION = 'text-muted-foreground text-[13px]';\n\n/** The background of the surface the aside sits on, for parts that must cover what scrolls under them. */\nexport const ASIDE_SURFACE = 'bg-[var(--aside-surface)]';\n\ntype AsideTextProps = { className?: string; children: React.ReactNode };\n\nexport function AsideTitle({ className, children }: AsideTextProps) {\n  const host = useAsideHost();\n  if (host === 'sheet') {\n    return <SheetTitle className={className}>{children}</SheetTitle>;\n  }\n  return <h2 className={cn(TITLE, className)}>{children}</h2>;\n}\n\nexport function AsideDescription({ className, children }: AsideTextProps) {\n  const host = useAsideHost();\n  if (host === 'sheet') {\n    return (\n      <SheetDescription className={className}>{children}</SheetDescription>\n    );\n  }\n  return <p className={cn(DESCRIPTION, className)}>{children}</p>;\n}\n\n/** The close button of the sheet's header. The preview has nothing to close, so it draws nothing. */\nexport function AsideCloseButton({\n  label = 'Close panel',\n  className,\n}: {\n  label?: string;\n  className?: string;\n}) {\n  const host = useAsideHost();\n  if (host === 'preview') {\n    return null;\n  }\n  return (\n    <SheetClose\n      render={\n        <Button\n          variant='ghost'\n          size='icon-sm'\n          aria-label={label}\n          className={cn('text-muted-foreground', className)}\n        />\n      }\n    >\n      <XIcon />\n    </SheetClose>\n  );\n}\n\ntype AsidePreviewProps = {\n  /** The content, drawn twice: open in the page, and inside the sheet the trigger opens. */\n  children: React.ReactNode;\n  triggerLabel: string;\n  side?: AsideSide;\n  className?: string;\n};\n\n/** Shows an aside open and whole on the page, with a small trigger that slides the same content in as a real sheet. */\nexport function AsidePreview({\n  children,\n  triggerLabel,\n  side = 'right',\n  className,\n}: AsidePreviewProps) {\n  return (\n    <div className='flex w-full flex-col items-center gap-4'>\n      <AsideHostContext.Provider value='preview'>\n        <div\n          className={cn(\n            'surface-raised flex w-full max-w-sm flex-col overflow-hidden rounded-2xl text-left [--aside-surface:var(--popover)]',\n            className\n          )}\n        >\n          {children}\n        </div>\n      </AsideHostContext.Provider>\n      <Sheet>\n        <SheetTrigger render={<Button variant='outline' size='sm' />}>\n          <PanelsTopLeftIcon />\n          {triggerLabel}\n        </SheetTrigger>\n        <SheetContent\n          side={side}\n          showCloseButton={false}\n          className={cn('gap-0 p-0 [--aside-surface:var(--card)]', className)}\n        >\n          <AsideHostContext.Provider value='sheet'>\n            {children}\n          </AsideHostContext.Provider>\n        </SheetContent>\n      </Sheet>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/aside/_parts/aside-frame.tsx"
    },
    {
      "path": "registry/ndeko/components/aside/_parts/copy-icon-button.tsx",
      "content": "'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { CheckIcon, CopyIcon, LinkIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { Swap } from './swap';\n\nconst COPIED_RESET_MS = 1600;\n\ntype CopyGlyph = 'copy' | 'link';\n\nfunction glyphOf(isCopied: boolean, glyph: CopyGlyph) {\n  if (isCopied) {\n    return <CheckIcon className='text-success-foreground' />;\n  }\n  if (glyph === 'link') {\n    return <LinkIcon />;\n  }\n  return <CopyIcon />;\n}\n\ntype CopyIconButtonProps = {\n  text: string;\n  label: string;\n  /** Announced once the text is on the clipboard. */\n  announcement: string;\n  glyph?: CopyGlyph;\n  className?: string;\n};\n\nexport function CopyIconButton({\n  text,\n  label,\n  announcement,\n  glyph = 'copy',\n  className,\n}: CopyIconButtonProps) {\n  const [isCopied, setIsCopied] = useState(false);\n  const icon = glyphOf(isCopied, glyph);\n  const iconKey = String(isCopied);\n\n  useEffect(() => {\n    if (!isCopied) {\n      return;\n    }\n    const timeout = window.setTimeout(() => {\n      setIsCopied(false);\n    }, COPIED_RESET_MS);\n    return () => window.clearTimeout(timeout);\n  }, [isCopied]);\n\n  async function copy() {\n    try {\n      await navigator.clipboard.writeText(text);\n      setIsCopied(true);\n    } catch {\n      setIsCopied(false);\n    }\n  }\n\n  return (\n    <>\n      <Button\n        variant='ghost'\n        size='icon-sm'\n        aria-label={label}\n        onClick={copy}\n        className={cn('text-muted-foreground', className)}\n      >\n        <Swap swapKey={iconKey}>{icon}</Swap>\n      </Button>\n      <span className='sr-only' role='status'>\n        {isCopied && announcement}\n      </span>\n    </>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/aside/_parts/copy-icon-button.tsx"
    },
    {
      "path": "registry/ndeko/components/aside/_parts/motion.ts",
      "content": "import type { Transition, Variants } from 'motion/react';\n\nexport const SWAP_TRANSITION: Transition = {\n  duration: 0.15,\n  ease: [0.2, 0, 0, 1],\n};\n\nconst TRAVEL_SPRING: Transition = { type: 'spring', bounce: 0, duration: 0.3 };\n\nconst INSTANT: Transition = { duration: 0 };\n\nconst ENTER: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst LEAVE: Transition = { duration: 0.14, ease: [0.23, 1, 0.32, 1] };\n\nconst ICON_SWAP: 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 LABEL_SWAP: Variants = {\n  enter: { opacity: 0, filter: 'blur(2px)' },\n  visible: { opacity: 1, filter: 'blur(0px)' },\n  exit: { opacity: 0, filter: 'blur(2px)' },\n};\n\nconst FADE: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1 },\n  exit: { opacity: 0 },\n};\n\nconst HEIGHT_PRESENCE: Variants = {\n  hidden: { height: 0, opacity: 0, overflow: 'hidden', transition: LEAVE },\n  shown: {\n    height: 'auto',\n    opacity: 1,\n    transition: ENTER,\n    transitionEnd: { overflow: 'visible' },\n  },\n};\n\nconst FADE_PRESENCE: Variants = {\n  hidden: { opacity: 0, transition: LEAVE },\n  shown: { opacity: 1, transition: ENTER },\n};\n\nconst CHIP_PRESENCE: Variants = {\n  hidden: { opacity: 0, scale: 0.9, transition: LEAVE },\n  shown: { opacity: 1, scale: 1, transition: ENTER },\n};\n\nexport type SwapKind = 'icon' | 'label';\n\nexport function swapVariantsOf(\n  shouldReduceMotion: boolean | null,\n  kind: SwapKind = 'icon'\n) {\n  if (shouldReduceMotion) {\n    return FADE;\n  }\n  if (kind === 'label') {\n    return LABEL_SWAP;\n  }\n  return ICON_SWAP;\n}\n\n/** A row that joins or leaves a list: its height opens or collapses, so what follows slides instead of jumping. */\nexport function rowVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_PRESENCE;\n  }\n  return HEIGHT_PRESENCE;\n}\n\nexport function chipVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_PRESENCE;\n  }\n  return CHIP_PRESENCE;\n}\n\nexport function travelOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return TRAVEL_SPRING;\n}\n",
      "type": "registry:component",
      "target": "components/aside/_parts/motion.ts"
    },
    {
      "path": "registry/ndeko/components/aside/_parts/people.ts",
      "content": "export type Presence = 'tracking' | 'online' | 'away' | 'offline';\n\nexport type Person = {\n  id: string;\n  name: string;\n  email: string;\n  title: string;\n  presence: Presence;\n};\n\nexport const PEOPLE: Person[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n    email: 'amara@lattice.example',\n    title: 'Product designer',\n    presence: 'tracking',\n  },\n  {\n    id: 'lucas',\n    name: 'Lucas Moreau',\n    email: 'lucas@lattice.example',\n    title: 'Engineering lead',\n    presence: 'online',\n  },\n  {\n    id: 'priya',\n    name: 'Priya Raman',\n    email: 'priya@lattice.example',\n    title: 'Frontend engineer',\n    presence: 'online',\n  },\n  {\n    id: 'mateo',\n    name: 'Mateo Silva',\n    email: 'mateo@lattice.example',\n    title: 'Backend engineer',\n    presence: 'away',\n  },\n  {\n    id: 'hana',\n    name: 'Hana Kobayashi',\n    email: 'hana@lattice.example',\n    title: 'Product manager',\n    presence: 'tracking',\n  },\n  {\n    id: 'jonas',\n    name: 'Jonas Weber',\n    email: 'jonas@lattice.example',\n    title: 'QA engineer',\n    presence: 'offline',\n  },\n  {\n    id: 'zola',\n    name: 'Zola Mbeki',\n    email: 'zola@lattice.example',\n    title: 'Content designer',\n    presence: 'online',\n  },\n];\n\nfunction isKnownPerson(person: Person | undefined): person is Person {\n  return person !== undefined;\n}\n\nexport function peopleByIds(ids: string[]) {\n  const found = ids.map((id) => PEOPLE.find((person) => person.id === id));\n  return found.filter(isKnownPerson);\n}\n\nexport function firstNameOf(person: Person) {\n  const [firstName] = person.name.split(' ');\n  return firstName;\n}\n",
      "type": "registry:component",
      "target": "components/aside/_parts/people.ts"
    },
    {
      "path": "registry/ndeko/components/aside/_parts/person-avatar.tsx",
      "content": "import {\n  CheckIcon,\n  ClockIcon,\n  MinusIcon,\n  MoonIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\n\nimport type { Person, Presence } from './people';\n\ntype PresenceMeta = { label: string; color: string; icon: Icon };\n\nexport const PRESENCE_META: Record<Presence, PresenceMeta> = {\n  tracking: {\n    label: 'Tracking time',\n    color: 'var(--primary)',\n    icon: ClockIcon,\n  },\n  online: { label: 'Online', color: 'var(--success)', icon: CheckIcon },\n  away: { label: 'Away', color: 'var(--warning)', icon: MoonIcon },\n  offline: {\n    label: 'Offline',\n    color: 'var(--muted-foreground)',\n    icon: MinusIcon,\n  },\n};\n\ntype AvatarSize = 'xs' | 'sm' | 'md' | 'lg';\n\nconst AVATAR_SIZE: Record<AvatarSize, string> = {\n  xs: 'size-5',\n  sm: 'size-6',\n  md: 'size-8',\n  lg: 'size-12',\n};\n\nconst BADGE_SIZE: Record<AvatarSize, string> = {\n  xs: 'size-2.5 [&_svg]:size-1.5',\n  sm: 'size-3 [&_svg]:size-2',\n  md: 'size-3.5 [&_svg]:size-2',\n  lg: 'size-4.5 [&_svg]:size-3',\n};\n\ntype PersonAvatarProps = {\n  person: Pick<Person, 'name'>;\n  size?: AvatarSize;\n  /** Drawn as a small glyph on the avatar, never as a plain dot; its label is read by screen readers. */\n  presence?: Presence;\n  className?: string;\n};\n\nexport function PersonAvatar({\n  person,\n  size = 'md',\n  presence,\n  className,\n}: PersonAvatarProps) {\n  return (\n    <span className={cn('relative inline-flex shrink-0', className)}>\n      <Avatar className={AVATAR_SIZE[size]} seed={person.name} />\n      {presence && <PresenceGlyph presence={presence} size={size} />}\n    </span>\n  );\n}\n\nfunction PresenceGlyph({\n  presence,\n  size,\n}: {\n  presence: Presence;\n  size: AvatarSize;\n}) {\n  const meta = PRESENCE_META[presence];\n  const Glyph = meta.icon;\n  const badgeStyle = { '--chip': meta.color } as React.CSSProperties;\n\n  return (\n    <>\n      <span className='absolute -right-0.5 -bottom-0.5 flex rounded-full bg-[var(--aside-surface,var(--popover))] p-px'>\n        <span\n          style={badgeStyle}\n          className={cn(\n            'chip-3d flex items-center justify-center rounded-full',\n            BADGE_SIZE[size]\n          )}\n        >\n          <Glyph strokeWidth={2.75} />\n        </span>\n      </span>\n      <span className='sr-only'>{meta.label}</span>\n    </>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/aside/_parts/person-avatar.tsx"
    },
    {
      "path": "registry/ndeko/components/aside/_parts/swap.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport { SWAP_TRANSITION, swapVariantsOf, type SwapKind } from './motion';\n\ntype SwapProps = {\n  /** Changes when the content becomes another one: the old leaves while the new arrives in its place. */\n  swapKey: string;\n  kind?: SwapKind;\n  className?: string;\n  children: React.ReactNode;\n};\n\nexport function Swap({\n  swapKey,\n  kind = 'icon',\n  className,\n  children,\n}: SwapProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion, kind);\n\n  return (\n    <span className={cn('relative inline-flex items-center', className)}>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={swapKey}\n          className='inline-flex items-center gap-[inherit] whitespace-nowrap'\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          transition={SWAP_TRANSITION}\n        >\n          {children}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/aside/_parts/swap.tsx"
    },
    {
      "path": "registry/ndeko/components/aside/_parts/task-meta.tsx",
      "content": "import {\n  BookmarkIcon,\n  CheckIcon,\n  ChevronDownIcon,\n  ChevronUpIcon,\n  CircleAlertIcon,\n  CircleCheckIcon,\n  CircleDashedIcon,\n  CircleIcon,\n  EclipseIcon,\n  EyeIcon,\n  MinusIcon,\n  TriangleAlertIcon,\n  ZapIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nexport type Meta = { label: string; color: string; icon: Icon };\n\nexport type StatusId =\n  'backlog' | 'todo' | 'in-progress' | 'in-review' | 'done';\n\nexport type PriorityId = 'urgent' | 'high' | 'medium' | 'low';\n\nexport type IssueType = 'task' | 'bug' | 'story' | 'epic';\n\nexport const STATUS_ORDER: StatusId[] = [\n  'backlog',\n  'todo',\n  'in-progress',\n  'in-review',\n  'done',\n];\n\nexport const STATUS_META: Record<StatusId, Meta> = {\n  backlog: {\n    label: 'Backlog',\n    color: 'var(--muted-foreground)',\n    icon: CircleDashedIcon,\n  },\n  todo: { label: 'Todo', color: 'var(--info)', icon: CircleIcon },\n  'in-progress': {\n    label: 'In progress',\n    color: 'var(--warning)',\n    icon: EclipseIcon,\n  },\n  'in-review': { label: 'In review', color: 'var(--primary)', icon: EyeIcon },\n  done: { label: 'Done', color: 'var(--success)', icon: CircleCheckIcon },\n};\n\nexport const PRIORITY_ORDER: PriorityId[] = ['urgent', 'high', 'medium', 'low'];\n\nexport const PRIORITY_META: Record<PriorityId, Meta> = {\n  urgent: {\n    label: 'Urgent',\n    color: 'var(--destructive)',\n    icon: TriangleAlertIcon,\n  },\n  high: { label: 'High', color: 'var(--warning)', icon: ChevronUpIcon },\n  medium: { label: 'Medium', color: 'var(--info)', icon: MinusIcon },\n  low: {\n    label: 'Low',\n    color: 'var(--muted-foreground)',\n    icon: ChevronDownIcon,\n  },\n};\n\nexport const ISSUE_TYPE_META: Record<IssueType, Meta> = {\n  task: { label: 'Task', color: 'var(--info)', icon: CheckIcon },\n  bug: { label: 'Bug', color: 'var(--destructive)', icon: CircleAlertIcon },\n  story: { label: 'Story', color: 'var(--success)', icon: BookmarkIcon },\n  epic: { label: 'Epic', color: 'var(--primary)', icon: ZapIcon },\n};\n\nexport function isStatusId(value: unknown): value is StatusId {\n  return STATUS_ORDER.some((status) => status === value);\n}\n\nexport function IssueTypeGem({\n  type,\n  className,\n}: {\n  type: IssueType;\n  className?: string;\n}) {\n  const meta = ISSUE_TYPE_META[type];\n  const TypeGlyph = meta.icon;\n  const gemStyle = { '--gem': meta.color } as React.CSSProperties;\n\n  return (\n    <span\n      style={gemStyle}\n      className={cn(\n        'gem-plate inline-flex size-4 shrink-0 items-center justify-center rounded-[4px]',\n        className\n      )}\n    >\n      <TypeGlyph className='size-2.5' strokeWidth={2.75} />\n      <span className='sr-only'>{meta.label}</span>\n    </span>\n  );\n}\n\nexport function MetaGlyph({\n  meta,\n  className,\n}: {\n  meta: Meta;\n  className?: string;\n}) {\n  const Glyph = meta.icon;\n  const glyphStyle = { color: meta.color } as React.CSSProperties;\n\n  return (\n    <Glyph\n      style={glyphStyle}\n      strokeWidth={2.25}\n      className={cn('size-3.5 shrink-0', className)}\n    />\n  );\n}\n",
      "type": "registry:component",
      "target": "components/aside/_parts/task-meta.tsx"
    }
  ],
  "categories": [
    "components",
    "aside"
  ],
  "type": "registry:component"
}