{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-modal-task",
  "type": "registry:block",
  "title": "Task modal",
  "description": "A task opened in a modal: its properties and progress, subtasks to tick off, and tabs over the activity log.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/checkbox.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/modal.json",
    "https://wideset.co/r/progress-bar.json",
    "https://wideset.co/r/status-badge.json",
    "https://wideset.co/r/switch.json",
    "https://wideset.co/r/tabs.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/modal-task/activity-timeline.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/activity-timeline.tsx",
      "content": "'use client';\n\n// TODO(custom): activity timeline (dot, entry, date, subtask card); no Timeline in Wideset.\nimport { RiChat2Line, RiMoreFill, RiUserFill } from '@remixicon/react';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { StatusBadge } from '@/components/ui/wideset/status-badge/StatusBadge';\n\nimport type { Activity } from './data';\nimport { PersonAvatar } from './person-avatar';\n\n/** The task's history on a line of dots, newest first; an entry about a subtask shows its card. */\nexport function ActivityTimeline({ items }: { items: Activity[] }) {\n  return (\n    <ol className=\"gap-ws-12 py-ws-5 flex flex-col\">\n      {items.map((item, index) => (\n        <li key={item.id} className=\"gap-ws-8 relative flex\">\n          {/* Figma's dot (#9a9a9a) and line (#e5e5e5) are unbound: the nearest tokens stand in. */}\n          <span aria-hidden=\"true\" className=\"w-ws-15 pt-ws-6 flex shrink-0 justify-center\">\n            <span className=\"size-ws-5 rounded-ws-control-full relative bg-(--ws-semantic-stroke-neutral)\" />\n          </span>\n          {index < items.length - 1 ? (\n            <span\n              aria-hidden=\"true\"\n              className=\"border-ws-static-subtle left-ws-10 top-ws-11 -bottom-ws-16 absolute border-l\"\n            />\n          ) : null}\n          <div className=\"gap-ws-7 flex min-w-0 flex-1 flex-col\">\n            <div className=\"gap-ws-3 flex flex-col\">\n              <p className=\"gap-ws-3 typography-label-strong-sm text-ws-static-base flex items-center\">\n                {item.text}\n                {item.person ? (\n                  <>\n                    {/* No status dot, unlike Figma's photos: at 20px it would sit on the initials. */}\n                    <PersonAvatar\n                      size=\"xs\"\n                      name={item.person.name}\n                      initials={item.person.initials}\n                      color={item.person.color}\n                    />\n                    {item.person.name.split(' ')[0]}\n                  </>\n                ) : null}\n              </p>\n              <p className=\"typography-body-md text-ws-static-subtle\">{item.date}</p>\n            </div>\n            {item.subtask ? (\n              <div className=\"bg-ws-static-highlight-base rounded-ws-container-sm gap-ws-3 px-ws-7 pt-ws-5 pb-ws-7 flex flex-col\">\n                <div className=\"gap-ws-5 p-ws-3 flex items-start\">\n                  <p className=\"typography-label-sm text-ws-static-strong min-w-0 flex-1\">\n                    {item.subtask.title}\n                  </p>\n                  <IconButton\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    icon={RiMoreFill}\n                    aria-label={`Actions for ${item.subtask.title}`}\n                  />\n                </div>\n                {/* Figma's badges are 24px tall with Small's type: Small sits in a 24px row. */}\n                <div className=\"h-ws-12 px-ws-3 flex items-center justify-between\">\n                  <div className=\"gap-ws-3 flex items-center\">\n                    <StatusBadge size=\"sm\">\n                      <StatusBadge.Icon icon={RiUserFill} />\n                      <StatusBadge.Label>{item.subtask.reviewers} reviewers</StatusBadge.Label>\n                    </StatusBadge>\n                    <StatusBadge size=\"sm\">\n                      <StatusBadge.Label>Done by {item.subtask.doneBy}</StatusBadge.Label>\n                    </StatusBadge>\n                  </div>\n                  {/* The comment count has no fill in Figma, which StatusBadge cannot do. */}\n                  <span className=\"gap-ws-3 px-ws-4 typography-caption-strong-md text-ws-semantic-on-subtle-neutral flex items-center\">\n                    <RiChat2Line aria-hidden=\"true\" className=\"size-ws-8\" />\n                    {item.subtask.comments}\n                    <span className=\"sr-only\"> comments</span>\n                  </span>\n                </div>\n              </div>\n            ) : null}\n          </div>\n        </li>\n      ))}\n    </ol>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-task/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/data.ts",
      "content": "import type { AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\n\nexport type Person = { name: string; initials: string; color: AvatarColor };\n\nexport type Subtask = {\n  id: string;\n  title: string;\n  /** The line under the title. */\n  description: string;\n  done: boolean;\n  /** How far a subtask under way is (0–100): a ring beside it until it is done. */\n  progress?: number;\n};\n\n/** One entry in the task's history. */\nexport type Activity = {\n  id: string;\n  /** What happened, e.g. \"Task created by\"; `person` follows it when there is one. */\n  text: string;\n  person?: Person;\n  date: string;\n  /** The subtask the entry is about, drawn as a card under the date. */\n  subtask?: { title: string; reviewers: number; doneBy: string; comments: number };\n};\n\nexport type TaskDetail = {\n  title: string;\n  /** The line under the title. */\n  due: string;\n  private: boolean;\n  assignee: Person;\n  priority: string;\n  subtasks: Subtask[];\n  /** Newest first. */\n  activity: Activity[];\n  notes: string;\n};\n\nconst priya: Person = { name: 'Priya Raman', initials: 'PR', color: 'blue' };\nconst maya: Person = { name: 'Maya Okafor', initials: 'MO', color: 'orange' };\n\n/** The task the modal opens on. */\nexport const task: TaskDetail = {\n  title: 'Launch social media campaign',\n  due: 'Due Nov 14, 2026',\n  private: false,\n  assignee: priya,\n  priority: 'High priority',\n  subtasks: [\n    {\n      id: 'content-plan',\n      title: 'Create campaign content plan',\n      description: 'Channels, formats and posting dates',\n      done: true,\n    },\n    {\n      id: 'graphics',\n      title: 'Design promotional graphics',\n      description: 'Banners and story templates',\n      done: false,\n      progress: 44,\n    },\n  ],\n  activity: [\n    {\n      id: 'completed',\n      text: 'Subtask has been completed',\n      date: 'Nov 9, 2026',\n      subtask: {\n        title: 'Create campaign content plan',\n        reviewers: 2,\n        doneBy: 'Priya',\n        comments: 3,\n      },\n    },\n    {\n      id: 'subtasks-added',\n      text: 'Subtasks added by',\n      person: priya,\n      date: 'Nov 6, 2026',\n    },\n    {\n      id: 'created',\n      text: 'Task created by',\n      person: maya,\n      date: 'Nov 6, 2026',\n    },\n  ],\n  notes:\n    'Lead with the product film on launch day and keep the first week to one post a day. Paid promotion starts once the graphics are signed off.',\n};\n"
    },
    {
      "path": "src/blocks/modal-task/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useState } from 'react';\n\nimport { task } from './data';\nimport { TaskModal } from './task-modal';\n\n/** Task modal: a task opened over the page, here over an empty page that reopens it. */\nexport default function ModalTaskBlock() {\n  const [open, setOpen] = useState(true);\n\n  return (\n    <div className=\"ws-block-utility bg-ws-static-foreground flex h-dvh items-center justify-center\">\n      <Button variant=\"secondary\" preset=\"border\" onClick={() => setOpen(true)}>\n        Open task\n      </Button>\n      <TaskModal task={task} open={open} onOpenChange={setOpen} />\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-task/keyboard-hints.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/keyboard-hints.tsx",
      "content": "'use client';\n\n// TODO(custom): keyboard hints (a key chip and what it does) and the keys they name; Wideset has no Kbd / shortcut component, so the key is the box of Button `xs` Border drawn by hand.\nimport {\n  type RemixiconComponentType,\n  RiArrowDownSLine,\n  RiArrowLeftLine,\n  RiArrowUpSLine,\n} from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport type { KeyboardEvent, ReactNode } from 'react';\n\n/**\n * The hints in the modal's footer strip, as Figma draws them: moving through the modal, going\n * back to where it was opened from, and closing. Esc is the Modal's own; `modalKeys` wires the\n * other two on `Modal.Content`, so every hint does what it says.\n */\nexport function KeyboardHints() {\n  return (\n    <>\n      <div className=\"gap-ws-12 flex items-center\">\n        <Hint\n          keys={\n            <span className=\"gap-ws-3 flex\">\n              <Key icon={RiArrowUpSLine} name=\"Up arrow\" />\n              <Key icon={RiArrowDownSLine} name=\"Down arrow\" />\n            </span>\n          }\n        >\n          Navigate\n        </Hint>\n        <Hint keys={<Key icon={RiArrowLeftLine} name=\"Left arrow\" />}>Return to parent</Hint>\n      </div>\n      <Hint keys={<Key>esc</Key>}>Close</Hint>\n    </>\n  );\n}\n\n/** One hint: the keys, then what they do. */\nfunction Hint({ keys, children }: { keys: ReactNode; children: string }) {\n  return (\n    <span className=\"gap-ws-5 typography-body-md text-ws-static-subtle flex items-center\">\n      {keys}\n      {children}\n    </span>\n  );\n}\n\n/** A key as a `kbd`, 24px high. An icon key names itself for screen readers. */\nfunction Key({\n  icon: Icon,\n  name,\n  children,\n}: {\n  icon?: RemixiconComponentType;\n  name?: string;\n  children?: string;\n}) {\n  return (\n    <kbd\n      className={cn(\n        'font-ws-body border-ws-dynamic-secondary-default bg-ws-static-highlight-subtle shadow-ws-controls-control rounded-ws-control-md h-ws-12 typography-caption-strong-md text-ws-dynamic-secondary-default flex items-center justify-center border',\n        Icon ? 'w-ws-12' : 'px-ws-5',\n      )}\n    >\n      {Icon ? (\n        <>\n          <Icon aria-hidden=\"true\" className=\"size-ws-8 shrink-0\" />\n          <span className=\"sr-only\">{name}</span>\n        </>\n      ) : (\n        children\n      )}\n    </kbd>\n  );\n}\n\n/** Places where the arrows already mean something: a list, a choice, tabs, a menu, a number. */\nconst OWN_ARROWS =\n  'textarea, select, [role=\"combobox\"], [aria-haspopup], [role=\"listbox\"], [role=\"radiogroup\"], [role=\"radio\"], [role=\"tablist\"], [role=\"tab\"], [role=\"menu\"], [role=\"slider\"], input[type=\"number\"], input[type=\"range\"]';\n\nconst FOCUSABLE =\n  'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n/** In a text field the caret moves with Left, unless it stands at the very start. */\nconst caretAtStart = (target: Element) =>\n  !(target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) ||\n  (target.selectionStart === 0 && target.selectionEnd === 0);\n\n/**\n * The keys the hints name, for `Modal.Content`'s `onKeyDown`: Up and Down move to the previous or\n * next control in the modal, Left goes back with `onBack`. Neither takes a key from a place that\n * uses it (a select, a radio group, tabs, a list, a menu), nor one already handled; Left in a text\n * field only once the caret is at its start, so it still moves the caret.\n */\nexport function modalKeys(onBack: () => void) {\n  return (event: KeyboardEvent<HTMLElement>) => {\n    const { key, target, currentTarget } = event;\n    if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;\n    if (!(target instanceof Element) || target.closest(OWN_ARROWS)) return;\n    if (key === 'ArrowUp' || key === 'ArrowDown') {\n      const controls = [...currentTarget.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n        (element) => element.getClientRects().length > 0,\n      );\n      const next =\n        controls[controls.indexOf(target as HTMLElement) + (key === 'ArrowDown' ? 1 : -1)];\n      if (!next) return;\n      event.preventDefault();\n      next.focus();\n    } else if (key === 'ArrowLeft' && !event.shiftKey && caretAtStart(target)) {\n      event.preventDefault();\n      onBack();\n    }\n  };\n}\n"
    },
    {
      "path": "src/blocks/modal-task/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/people.assets.ts",
      "content": "// Portraits of the sample people as small JPEG data URLs (a block ships only .ts and .tsx).\n// Exported from the Wideset Core Figma file by people.cjs: do not edit by hand.\n\n/** A person’s photo by name. People who are not here show their initials. */\nexport const PHOTOS: Record<string, string | undefined> = {\n  'Maya Okafor':\n    'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXN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y2PyoSBR52q3WlHDHH3GgJpJ5Je+4lUDVwnnOKIJrI0nl3qVRLXS0CpWR0GKbLiJYW4TzdwYQEpdVyOhP8AV3H7U6WAOf8AuNcPVVv9oWSWyBlRQVJ+Y3H6ULhkKx4VbNW0yQHTOD6H/ZX/2Q==',\n};\n"
    },
    {
      "path": "src/blocks/modal-task/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/person-avatar.tsx",
      "content": "'use client';\n\nimport type { AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'color' | 'className' | 'title' | 'aria-hidden' | 'aria-label'\n> & {\n  /** The person's full name: the key their photo is filed under. */\n  name: string;\n  initials: string;\n  /** Leave empty beside the person's name; pass the name where the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when the sample people have one, otherwise their initials in\n * their colour. A real product mixes the two, so every place the block draws a person asks here\n * and the choice is made once. The initials stay as the fallback if the image fails to load.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...props }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...props} />\n  ) : (\n    <Avatar initials={initials} color={color} {...props} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-task/subtask-list.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/subtask-list.tsx",
      "content": "'use client';\n\n// TODO(custom): subtask list (checkbox rows in an outlined card, an add row under them); no checklist in Wideset.\nimport { RiAddLine } from '@remixicon/react';\nimport { Checkbox } from '@/components/ui/wideset/checkbox/Checkbox';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ProgressBar } from '@/components/ui/wideset/progress-bar/ProgressBar';\nimport { useId } from 'react';\n\nimport type { Subtask } from './data';\n\ntype SubtaskListProps = {\n  subtasks: Subtask[];\n  onToggle: (id: string, done: boolean) => void;\n};\n\n/**\n * The task's subtasks, ticked off in place. A subtask under way shows how far it is until it is\n * done; the words of the add row are its button's `label`, so the row is one target.\n */\nexport function SubtaskList({ subtasks, onToggle }: SubtaskListProps) {\n  const addId = useId();\n\n  return (\n    // Figma's stroke is inside the card: an inset ring keeps its 6px and 4px padding.\n    <div className=\"bg-ws-static-highlight-base rounded-ws-container-md pt-ws-4 pb-ws-3 inset-ring inset-ring-(--ws-static-stroke-base)\">\n      <ul aria-label=\"Subtasks\">\n        {subtasks.map((subtask) => (\n          <li\n            key={subtask.id}\n            className=\"gap-ws-9 px-ws-9 py-ws-5 flex items-center justify-between\"\n          >\n            <Checkbox\n              label={subtask.title}\n              description={subtask.description}\n              checked={subtask.done}\n              onCheckedChange={(checked) => onToggle(subtask.id, checked === true)}\n            />\n            {subtask.done || subtask.progress === undefined ? null : (\n              <ProgressBar\n                type=\"circle\"\n                value={subtask.progress}\n                aria-label={`${subtask.title} progress`}\n              />\n            )}\n          </li>\n        ))}\n      </ul>\n      <div className=\"h-ws-15 gap-ws-6 px-ws-8 flex items-center\">\n        <IconButton\n          id={addId}\n          variant=\"secondary\"\n          preset=\"ghost\"\n          size=\"xs\"\n          icon={RiAddLine}\n          aria-label=\"Add subtask\"\n        />\n        <label\n          htmlFor={addId}\n          aria-hidden=\"true\"\n          className=\"typography-body-md text-ws-static-subtle\"\n        >\n          Add subtask\n        </label>\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-task/task-modal.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/task-modal.tsx",
      "content": "'use client';\n\nimport { RiAddLine, RiMoreFill } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\nimport { Switch } from '@/components/ui/wideset/switch/Switch';\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\nimport { useState } from 'react';\n\nimport { ActivityTimeline } from './activity-timeline';\nimport type { TaskDetail } from './data';\nimport { KeyboardHints, modalKeys } from './keyboard-hints';\nimport { SubtaskList } from './subtask-list';\nimport { TaskProperties } from './task-properties';\n\ntype TaskModalProps = {\n  task: TaskDetail;\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n};\n\n/**\n * Figma's Modal `Type=Task`: a task opened over the page. The header and the keyboard hints stay\n * put and everything between them scrolls, so the modal never outgrows a short window. Ticking a\n * subtask moves the task's progress, which is the average of its subtasks. Up and Down move\n * between its controls, Left goes back to the page it was opened from.\n */\nexport function TaskModal({ task, open, onOpenChange }: TaskModalProps) {\n  // Kept here, not in the switch: the modal's content unmounts when it closes.\n  const [isPrivate, setIsPrivate] = useState(task.private);\n  const [subtasks, setSubtasks] = useState(task.subtasks);\n  const progress = Math.round(\n    subtasks.reduce((sum, subtask) => sum + (subtask.done ? 100 : (subtask.progress ?? 0)), 0) /\n      subtasks.length,\n  );\n\n  return (\n    <Modal open={open} onOpenChange={onOpenChange}>\n      {/* The close button sits in the header row, beside the task's actions. */}\n      <Modal.Content\n        showCloseButton={false}\n        // The dialog takes the focus, not its first control: a task is read from the top. It is\n        // not a control, so it shows no ring (Popup's content does the same).\n        className=\"ws-block-utility outline-hidden\"\n        onOpenAutoFocus={(event) => {\n          event.preventDefault();\n          if (event.currentTarget instanceof HTMLElement) event.currentTarget.focus();\n        }}\n        onKeyDown={modalKeys(() => onOpenChange(false))}\n      >\n        <div className=\"px-ws-12 py-ws-9 flex shrink-0 items-center justify-between\">\n          <Switch label=\"Private\" checked={isPrivate} onCheckedChange={setIsPrivate} />\n          <div className=\"gap-ws-5 flex items-center\">\n            <Button size=\"sm\" variant=\"secondary\" preset=\"border\">\n              Share\n            </Button>\n            <IconButton\n              size=\"sm\"\n              variant=\"secondary\"\n              preset=\"border\"\n              icon={RiMoreFill}\n              aria-label=\"More actions\"\n            />\n            <Modal.Close />\n          </div>\n        </div>\n\n        {/* The line over the footer is this region's, so it stays while the content scrolls. */}\n        <div className=\"border-ws-static-base ws-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto border-b\">\n          <div className=\"px-ws-11 pt-ws-11 pb-ws-9 flex flex-col\">\n            <Modal.Title className=\"-mt-ws-2\">{task.title}</Modal.Title>\n            <Modal.Description className=\"mt-ws-4 pb-ws-0\">{task.due}</Modal.Description>\n          </div>\n\n          <div className=\"px-ws-11 py-ws-8\">\n            <TaskProperties assignee={task.assignee} priority={task.priority} progress={progress} />\n          </div>\n\n          <div className=\"px-ws-11\">\n            <Button variant=\"primary\" preset=\"border\" size=\"sm\">\n              <Button.Icon icon={RiAddLine} />\n              Complete\n            </Button>\n          </div>\n\n          <div className=\"p-ws-11\">\n            <SubtaskList\n              subtasks={subtasks}\n              onToggle={(id, done) =>\n                setSubtasks((list) =>\n                  list.map((subtask) => (subtask.id === id ? { ...subtask, done } : subtask)),\n                )\n              }\n            />\n          </div>\n\n          {/* Figma lays the grey (Static/Fill/Alpha/Subtle) straight over the modal's fill. */}\n          <div className=\"bg-ws-static-alpha-subtle px-ws-11 py-ws-9 flex-1\">\n            <Tabs type=\"pills\" size=\"sm\" defaultValue=\"activity\" className=\"gap-ws-11\">\n              <Tabs.List aria-label=\"Task sections\">\n                <Tabs.Item value=\"activity\">\n                  <Tabs.Label>Activity log</Tabs.Label>\n                </Tabs.Item>\n                <Tabs.Item value=\"notes\">\n                  <Tabs.Label>Notes</Tabs.Label>\n                </Tabs.Item>\n              </Tabs.List>\n              <Tabs.Content value=\"activity\">\n                <ActivityTimeline items={task.activity} />\n              </Tabs.Content>\n              <Tabs.Content value=\"notes\">\n                <p className=\"py-ws-5 typography-body-md text-ws-static-base\">{task.notes}</p>\n              </Tabs.Content>\n            </Tabs>\n          </div>\n        </div>\n\n        <Modal.Footer variant=\"extension\" className=\"items-center\">\n          <KeyboardHints />\n        </Modal.Footer>\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-task/task-properties.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-task/task-properties.tsx",
      "content": "'use client';\n\n// TODO(custom): property rows (a name beside its value) and a priority dot; no DescriptionList or status dot in Wideset.\nimport { ProgressBar } from '@/components/ui/wideset/progress-bar/ProgressBar';\nimport type { ReactNode } from 'react';\n\nimport type { Person } from './data';\nimport { PersonAvatar } from './person-avatar';\n\ntype TaskPropertiesProps = {\n  assignee: Person;\n  priority: string;\n  /** 0–100, worked out from the subtasks. */\n  progress: number;\n};\n\n/** The task's properties, one to a 32px row: who has it, how urgent it is, how far along. */\nexport function TaskProperties({ assignee, priority, progress }: TaskPropertiesProps) {\n  return (\n    <dl className=\"flex flex-col\">\n      <Property label=\"Assigned to\">\n        {/* One letter: at 24px the status dot would sit on a second one. */}\n        <PersonAvatar\n          size=\"sm\"\n          name={assignee.name}\n          initials={assignee.initials.charAt(0)}\n          color={assignee.color}\n          status=\"online\"\n        />\n        {assignee.name}\n      </Property>\n      <Property label=\"Priority\">\n        {/* Figma's dot (#a11c2a) is unbound: the strong negative fill stands in. */}\n        <span\n          aria-hidden=\"true\"\n          className=\"size-ws-5 rounded-ws-control-full bg-ws-semantic-inverse-negative shrink-0\"\n        />\n        {priority}\n      </Property>\n      <Property label=\"Progress\">\n        <ProgressBar type=\"circle\" value={progress} aria-label=\"Task progress\" />\n      </Property>\n    </dl>\n  );\n}\n\n/** A property row: its name in a 120px column, the value 16px after it. */\nfunction Property({ label, children }: { label: string; children: ReactNode }) {\n  return (\n    <div className=\"h-ws-14 flex items-center\">\n      <dt className=\"typography-body-md text-ws-static-subtle w-[7.5rem] shrink-0\">{label}</dt>\n      <dd className=\"gap-ws-5 pl-ws-9 typography-label-strong-sm text-ws-static-base flex items-center\">\n        {children}\n      </dd>\n    </div>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
