{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"task-card","type":"registry:block","title":"Task card","description":"Tasks on a textured tray in your colours: tick one and a line travels slowly through its name, the ink fading behind it, then done tasks glide below the open ones.","author":"Hairline UI","dependencies":["lucide-react"],"registryDependencies":["https://hairlineui.com/r/text-morph.json?as=dependency"],"files":[{"path":"registry/task-card.tsx","type":"registry:component","content":"// Hairline UI · task-card · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowUpRight, ChevronLeft, ChevronRight, Plus } from \"lucide-react\";\nimport { TextMorph } from \"./text-morph\";\n\n/* ─────────────────────────────────────────────────────────\n * TASK CARD: a list of tasks on a tinted tray, a few lists deep\n *\n *   tray      the card sits on a tray of the list's two colours with\n *             a fine engraved texture; finish the list and a band of\n *             light crosses it once\n *   tick      tap a task: the box fills with the same gradient and\n *             its check draws; then a line travels slowly through the\n *             name and the ink fades behind it as it goes, so the\n *             name greys exactly where it has been crossed\n *   sink      a moment after your last tick the done tasks glide\n *             down under the open ones (and an unticked one rises\n *             back), all in one move, so a run of ticks never\n *             reshuffles under your finger\n *   add       \"Add a task\" is the field: tap it, type, Enter; the\n *             new task folds in above the done ones and the field\n *             stays open for the next\n *   page      ‹ › move between your lists: the tray changes colour,\n *             the card slides the way you went and eases to its\n *             new height\n *\n * The tasks are yours: pass lists from your store and save in\n * onToggle and onAdd. A tick shows at once; throw or reject and it\n * goes back with a small shake.\n * ───────────────────────────────────────────────────────── */\n\nexport interface TaskItem {\n  id: string;\n  label: string;\n  done: boolean;\n  /** A short due label, e.g. \"Today\" or \"Fri\". */\n  due?: string;\n  /** Shows the due label in red. */\n  late?: boolean;\n  /** Who it's on: a small avatar (initials when there's no src). */\n  assignee?: { name: string; src?: string };\n}\n\nexport interface TaskList {\n  id: string;\n  title: string;\n  tasks: TaskItem[];\n  /** Where the footer link goes, e.g. the full project. */\n  href?: string;\n  /** The footer link's words. Defaults to \"View all\". */\n  linkLabel?: string;\n  /** The tray's colours: one CSS colour, or two for its gradient. Defaults to pairs of your chart colours. */\n  color?: string | [string, string];\n}\n\nexport interface TaskCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onToggle\"> {\n  lists: TaskList[];\n  /** The list showing, controlled; or leave it to the card with defaultList. */\n  list?: string;\n  defaultList?: string;\n  onListChange?: (listId: string) => void;\n  /** Save a tick or untick. Throw or reject to undo it on screen. */\n  onToggle?: (listId: string, taskId: string, done: boolean) => Promise<unknown> | void;\n  /** Save a new task; add it to the list you pass back. Without it there's no Add row. */\n  onAdd?: (listId: string, label: string) => Promise<unknown> | void;\n}\n\nconst EASE = \"cubic-bezier(0.16,1,0.3,1)\";\nconst FOCUS = \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50\";\nconst ROW = 36;\nconst SETTLE = 1000; // after the last tick, once its strike has finished\nconst STRIKE = 620;\n// Each list's two colours, as pairs of chart colours that sit well together.\nconst PAIRS: [number, number][] = [\n  [1, 3],\n  [5, 2],\n  [3, 1],\n  [2, 5],\n  [4, 1],\n];\n\nconst reducedQuery = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduced = (onChange: () => void) => {\n  const query = window.matchMedia(reducedQuery);\n  query.addEventListener(\"change\", onChange);\n  return () => query.removeEventListener(\"change\", onChange);\n};\nconst useReducedMotion = () =>\n  React.useSyncExternalStore(subscribeReduced, () => window.matchMedia(reducedQuery).matches, () => false);\n\nconst mix = (color: string, amount: number, into = \"transparent\") => `color-mix(in oklab, ${color} ${amount}%, ${into})`;\nconst openFirst = (tasks: TaskItem[]) => [...tasks.filter((t) => !t.done), ...tasks.filter((t) => t.done)].map((t) => t.id);\nconst initials = (name: string) =>\n  name\n    .split(/\\s+/)\n    .filter(Boolean)\n    .slice(0, 2)\n    .map((w) => w[0]?.toUpperCase())\n    .join(\"\");\nconst hue = (seed: string) => {\n  let h = 0;\n  for (const c of seed) h = (h * 31 + c.charCodeAt(0)) >>> 0;\n  return `var(--chart-${(h % 5) + 1}, var(--primary))`;\n};\nconst isThenable = (r: unknown): r is Promise<unknown> => !!r && typeof (r as Promise<unknown>).then === \"function\";\n\nexport function TaskCard({ lists, list, defaultList, onListChange, onToggle, onAdd, className = \"\", style, ...props }: TaskCardProps) {\n  const reduced = useReducedMotion();\n  const [ownList, setOwnList] = React.useState(defaultList ?? lists[0]?.id ?? \"\");\n  const currentId = list ?? ownList;\n  const index = Math.max(0, lists.findIndex((l) => l.id === currentId));\n  const current = lists[index];\n  const pair = PAIRS[index % PAIRS.length];\n  const [color, color2] = Array.isArray(current?.color)\n    ? current.color\n    : current?.color\n      ? [current.color, mix(current.color, 55, \"var(--foreground)\")]\n      : [`var(--chart-${pair[0]}, var(--primary))`, `var(--chart-${pair[1]}, var(--primary))`];\n\n  // A tick shows straight away and holds until your save settles.\n  const [pending, setPending] = React.useState<Record<string, boolean>>({});\n  const [order, setOrder] = React.useState<Record<string, string[]>>({});\n  const [adding, setAdding] = React.useState(false);\n  const [draft, setDraft] = React.useState(\"\");\n  const [busy, setBusy] = React.useState(false);\n  const [said, setSaid] = React.useState(\"\");\n\n  const boxRef = React.useRef<HTMLDivElement>(null);\n  const contentRef = React.useRef<HTMLDivElement>(null);\n  const inputRef = React.useRef<HTMLInputElement>(null);\n  const addRowRef = React.useRef<HTMLDivElement>(null);\n  const rowRefs = React.useRef(new Map<string, HTMLElement>());\n  const flip = React.useRef<Map<string, number> | null>(null);\n  const swap = React.useRef<{ dir: number; from: number } | null>(null);\n  const seen = React.useRef<{ list: string; ids: Set<string> }>({ list: \"\", ids: new Set() });\n  const settleTimer = React.useRef(0);\n  const liveTasks = React.useRef<{ list: string; tasks: TaskItem[] }>({ list: \"\", tasks: [] });\n  const sweepRef = React.useRef<HTMLDivElement>(null);\n  const finished = React.useRef<{ list: string; all: boolean } | null>(null);\n\n  const tasks = React.useMemo(() => (current?.tasks ?? []).map((t) => (t.id in pending ? { ...t, done: pending[t.id] } : t)), [current, pending]);\n  const byId = new Map(tasks.map((t) => [t.id, t]));\n\n  // The order on screen moves only when it settles; new tasks join the open ones.\n  const base = (current && order[current.id]) ?? openFirst(tasks);\n  const known = base.filter((id) => byId.has(id));\n  const fresh = tasks.filter((t) => !known.includes(t.id)).map((t) => t.id);\n  if (fresh.length) {\n    const at = known.findIndex((id) => byId.get(id)?.done);\n    known.splice(at < 0 ? known.length : at, 0, ...fresh);\n  }\n  const shown = known.map((id) => byId.get(id)!);\n  const done = tasks.filter((t) => t.done).length;\n  const total = tasks.length;\n  const allDone = total > 0 && done === total;\n\n  // Finishing a list sends one band of light across the tray.\n  React.useEffect(() => {\n    const id = current?.id ?? \"\";\n    const before = finished.current;\n    finished.current = { list: id, all: allDone };\n    if (!before || before.list !== id || before.all || !allDone || reduced) return;\n    sweepRef.current?.animate(\n      [\n        { transform: \"translateX(-100%)\", opacity: 0 },\n        { opacity: 1, offset: 0.25 },\n        { transform: \"translateX(100%)\", opacity: 0 },\n      ],\n      { duration: 1300, delay: STRIKE + 200, easing: \"cubic-bezier(0.45,0,0.25,1)\", fill: \"backwards\" },\n    );\n  }, [allDone, current?.id, reduced]);\n\n  React.useLayoutEffect(() => {\n    liveTasks.current = { list: current?.id ?? \"\", tasks };\n  });\n\n  React.useEffect(() => () => window.clearTimeout(settleTimer.current), []);\n\n  // Done tasks sink (and undone ones rise) in one glide from where they were.\n  const shownKey = known.join(\"|\");\n  const listId = current?.id ?? \"\";\n  React.useLayoutEffect(() => {\n    const before = flip.current;\n    flip.current = null;\n    // Rows that arrived since the last render fold in, unless the whole list just changed.\n    const ids = shownKey ? shownKey.split(\"|\") : [];\n    const same = seen.current.list === listId;\n    ids.forEach((id) => {\n      const el = rowRefs.current.get(id);\n      if (!el || reduced) return;\n      if (same && !seen.current.ids.has(id)) {\n        el.animate(\n          [\n            { height: \"0px\", opacity: 0, transform: \"translateY(-6px)\" },\n            { height: `${ROW}px`, opacity: 1, transform: \"none\" },\n          ],\n          { duration: 380, easing: EASE },\n        );\n        return;\n      }\n      const from = before?.get(id);\n      if (from === undefined) return;\n      const delta = from - el.offsetTop;\n      if (Math.abs(delta) < 1) return;\n      // Rows going down (the done ones) dim as they pass under the rising ones, so the crossing reads as one going behind.\n      const keyframes: Keyframe[] =\n        delta < 0\n          ? [{ transform: `translateY(${delta}px)`, opacity: 1 }, { opacity: 0.45, offset: 0.5 }, { transform: \"none\", opacity: 1 }]\n          : [{ transform: `translateY(${delta}px)` }, { transform: \"none\" }];\n      el.animate(keyframes, { duration: 600, easing: \"cubic-bezier(0.65,0,0.35,1)\" });\n    });\n    seen.current = { list: listId, ids: new Set(ids) };\n  }, [shownKey, listId, reduced]);\n\n  const settle = (animate: boolean) => {\n    window.clearTimeout(settleTimer.current);\n    const { list: listId, tasks: now } = liveTasks.current;\n    if (!listId) return;\n    if (animate) {\n      const snapshot = new Map<string, number>();\n      rowRefs.current.forEach((el, id) => snapshot.set(id, el.offsetTop));\n      flip.current = snapshot;\n    }\n    setOrder((o) => ({ ...o, [listId]: openFirst(now) }));\n  };\n\n  const toggle = (task: TaskItem) => {\n    if (!current) return;\n    const next = !task.done;\n    const listId = current.id;\n    // Hold the order on screen until it settles, whatever the tick (or your save) does to the list meanwhile.\n    const onScreen = known;\n    setOrder((o) => (o[listId] ? o : { ...o, [listId]: onScreen }));\n    setPending((p) => ({ ...p, [task.id]: next }));\n    const box = rowRefs.current.get(task.id)?.querySelector(\"[data-box]\");\n    if (next && box && !reduced)\n      box.animate([{ scale: \"1\" }, { scale: \"0.88\", offset: 0.4 }, { scale: \"1.04\", offset: 0.75 }, { scale: \"1\" }], { duration: 420, easing: \"cubic-bezier(0.34,1.36,0.64,1)\" });\n    setSaid(next ? `${task.label}, done.` : `${task.label}, not done.`);\n    window.clearTimeout(settleTimer.current);\n    settleTimer.current = window.setTimeout(() => settle(true), SETTLE);\n    const clear = () =>\n      setPending((p) => {\n        if (!(task.id in p)) return p;\n        const rest = { ...p };\n        delete rest[task.id];\n        return rest;\n      });\n    const refuse = () => {\n      clear();\n      const el = rowRefs.current.get(task.id);\n      if (el && !reduced) el.animate([{ translate: \"0 0\" }, { translate: \"-4px 0\" }, { translate: \"4px 0\" }, { translate: \"-2px 0\" }, { translate: \"0 0\" }], { duration: 380, easing: \"ease-out\" });\n    };\n    let result: unknown;\n    try {\n      result = onToggle?.(listId, task.id, next);\n    } catch {\n      refuse();\n      return;\n    }\n    if (isThenable(result)) result.then(clear, refuse);\n    else if (onToggle) clear();\n  };\n\n  const go = (dir: number) => {\n    if (lists.length < 2) return;\n    const nextIndex = (index + dir + lists.length) % lists.length;\n    const next = lists[nextIndex];\n    settle(false);\n    setAdding(false);\n    setDraft(\"\");\n    const box = boxRef.current;\n    const content = contentRef.current;\n    if (box && content && !reduced) {\n      // The old list leaves as a still copy; the new one renders in its place and slides in.\n      const ghost = content.cloneNode(true) as HTMLElement;\n      ghost.setAttribute(\"aria-hidden\", \"true\");\n      ghost.inert = true;\n      Object.assign(ghost.style, { position: \"absolute\", left: \"0\", right: \"0\", top: \"0\", pointerEvents: \"none\" });\n      box.appendChild(ghost);\n      const out = ghost.animate(\n        [\n          { opacity: 1, transform: \"none\", filter: \"blur(0px)\" },\n          { opacity: 0, transform: `translateX(${-dir * 28}px)`, filter: \"blur(4px)\" },\n        ],\n        { duration: 220, easing: EASE, fill: \"forwards\" },\n      );\n      out.onfinish = () => ghost.remove();\n      out.oncancel = () => ghost.remove();\n      swap.current = { dir, from: box.offsetHeight };\n    }\n    if (list === undefined) setOwnList(next.id);\n    onListChange?.(next.id);\n    setSaid(`${next.title}, list ${nextIndex + 1} of ${lists.length}.`);\n  };\n\n  React.useLayoutEffect(() => {\n    const s = swap.current;\n    swap.current = null;\n    const box = boxRef.current;\n    const content = contentRef.current;\n    if (!s || !box || !content) return;\n    content.animate(\n      [\n        { opacity: 0, transform: `translateX(${s.dir * 28}px)`, filter: \"blur(4px)\" },\n        { opacity: 1, transform: \"none\", filter: \"blur(0px)\" },\n      ],\n      { duration: 420, delay: 70, easing: EASE, fill: \"backwards\" },\n    );\n    const to = box.offsetHeight;\n    if (Math.abs(to - s.from) > 1) box.animate([{ height: `${s.from}px` }, { height: `${to}px` }], { duration: 460, easing: EASE });\n  }, [currentId]);\n\n  const submit = () => {\n    const label = draft.trim();\n    if (!label || !current || busy || !onAdd) return;\n    const listId = current.id;\n    const refuse = () => {\n      setBusy(false);\n      if (!reduced) addRowRef.current?.animate([{ translate: \"0 0\" }, { translate: \"-4px 0\" }, { translate: \"4px 0\" }, { translate: \"-2px 0\" }, { translate: \"0 0\" }], { duration: 380, easing: \"ease-out\" });\n    };\n    let result: unknown;\n    try {\n      result = onAdd(listId, label);\n    } catch {\n      refuse();\n      return;\n    }\n    const added = () => {\n      setBusy(false);\n      setDraft(\"\");\n      setSaid(`Added ${label}.`);\n      requestAnimationFrame(() => inputRef.current?.focus());\n    };\n    if (isThenable(result)) {\n      setBusy(true);\n      result.then(added, refuse);\n    } else added();\n  };\n\n  const status = total === 0 ? \"No tasks\" : done === total ? \"All done\" : `${done} of ${total}`;\n  const middle = mix(color, 50, color2);\n  // Text on the tray picks dark or light from the tray's own colour, keeping a little of its hue, so any theme colour reads.\n  const ink = `oklch(from ${middle} clamp(0.2, (0.66 - l) * 100, 0.98) calc(c * 0.5) h)`;\n  const checkInk = `oklch(from ${color} clamp(0.2, (0.7 - l) * 100, 0.99) 0 h)`;\n  const strikeLine = mix(color, 55, \"var(--muted-foreground)\");\n\n  return (\n    <div\n      className={`relative w-full overflow-clip rounded-[26px] p-[5px] ${className}`}\n      style={{\n        backgroundColor: middle,\n        backgroundImage: `repeating-linear-gradient(115deg, ${mix(\"var(--card)\", 16)} 0 1px, transparent 1px 7px), linear-gradient(105deg, ${color}, ${color2})`,\n        boxShadow: `inset 0 1px 0 ${mix(\"var(--card)\", 40)}, inset 0 0 0 1px ${mix(\"var(--foreground)\", 10)}`,\n        transitionTimingFunction: EASE,\n        ...style,\n      }}\n      {...props}\n    >\n      <div\n        ref={sweepRef}\n        aria-hidden=\"true\"\n        className=\"pointer-events-none absolute inset-0 opacity-0\"\n        style={{ background: `linear-gradient(100deg, transparent 30%, ${mix(\"var(--card)\", 50)} 50%, transparent 70%)` }}\n      />\n      <div aria-hidden=\"true\" data-natural-width className=\"grid h-0\" style={{ gridTemplateColumns: \"minmax(0, 340px)\" }} />\n      <div\n        className=\"relative rounded-[21px] bg-card text-card-foreground transition-shadow duration-500\"\n        style={{ boxShadow: `0 0 0 1px ${mix(mix(color, 60, \"var(--foreground)\"), 26)}`, transitionTimingFunction: EASE }}\n      >\n        <div ref={boxRef} className=\"relative overflow-clip rounded-[21px]\">\n          <div ref={contentRef} className=\"p-4 pb-2.5\">\n            <div className=\"flex items-baseline justify-between gap-3\">\n              <h3 className=\"min-w-0 truncate text-[15px] font-medium tracking-[-0.01em] text-foreground\">{current?.title}</h3>\n              <p className=\"shrink-0 text-[12px] text-muted-foreground tabular-nums\">\n                <TextMorph>{status}</TextMorph>\n              </p>\n            </div>\n            <ul aria-label={current?.title} className=\"mt-2\">\n              {shown.map((t) => (\n                <li\n                  key={t.id}\n                  ref={(el) => {\n                    if (el) rowRefs.current.set(t.id, el);\n                    else rowRefs.current.delete(t.id);\n                  }}\n                  className=\"overflow-clip\"\n                  style={{ height: ROW }}\n                >\n                  <button\n                    type=\"button\"\n                    role=\"checkbox\"\n                    aria-checked={t.done}\n                    onClick={() => toggle(t)}\n                    className={`group flex h-full w-full cursor-pointer items-center gap-3 rounded-[8px] text-left ${FOCUS}`}\n                  >\n                    <span\n                      aria-hidden=\"true\"\n                      data-box\n                      className={`relative flex size-[18px] shrink-0 items-center justify-center overflow-clip rounded-[6px] transition-[box-shadow,background-color] duration-200 ${\n                        t.done ? \"\" : \"shadow-[inset_0_0_0_1.5px_var(--box-rest)] group-hover:bg-[var(--box-wash)] group-hover:shadow-[inset_0_0_0_1.5px_var(--box-hover)]\"\n                      }`}\n                      style={{\n                        [\"--box-rest\" as string]: mix(\"var(--foreground)\", 24, \"var(--border)\"),\n                        [\"--box-hover\" as string]: mix(\"var(--foreground)\", 45, \"var(--border)\"),\n                        [\"--box-wash\" as string]: \"var(--muted)\",\n                      }}\n                    >\n                      <span\n                        className=\"absolute inset-0 transition-opacity duration-300\"\n                        style={{ background: `linear-gradient(135deg, ${color}, ${color2})`, opacity: t.done ? 1 : 0 }}\n                      />\n                      <svg viewBox=\"0 0 12 12\" className=\"relative size-3\" fill=\"none\">\n                        <path\n                          d=\"M2.5 6.2 5 8.6l4.6-5\"\n                          pathLength={1}\n                          stroke={checkInk}\n                          strokeWidth=\"1.8\"\n                          strokeLinecap=\"round\"\n                          strokeLinejoin=\"round\"\n                          style={{ strokeDasharray: 1, strokeDashoffset: t.done ? 0 : 1, transition: reduced ? \"none\" : `stroke-dashoffset 300ms ${EASE} ${t.done ? 60 : 0}ms` }}\n                        />\n                      </svg>\n                    </span>\n                    {/* The strike: a line travels slowly through the name and the ink fades behind it, exactly as far as it has gone. */}\n                    <span className=\"relative min-w-0\">\n                      <span className=\"block truncate text-[13.5px] text-foreground\">{t.label}</span>\n                      <span\n                        aria-hidden=\"true\"\n                        className=\"absolute inset-0 block truncate text-[13.5px] text-muted-foreground\"\n                        style={{\n                          clipPath: t.done ? \"inset(0 0 0 0)\" : \"inset(0 100% 0 0)\",\n                          transition: reduced ? \"none\" : t.done ? `clip-path ${STRIKE}ms cubic-bezier(0.65,0,0.35,1) 160ms` : `clip-path 320ms ${EASE}`,\n                        }}\n                      >\n                        {t.label}\n                      </span>\n                      <span\n                        aria-hidden=\"true\"\n                        className=\"absolute left-0 right-0 top-1/2 h-px origin-left rounded-full\"\n                        style={{\n                          background: strikeLine,\n                          transform: t.done ? \"none\" : \"scaleX(0)\",\n                          transformOrigin: t.done ? \"left\" : \"right\",\n                          transition: reduced ? \"none\" : t.done ? `transform ${STRIKE}ms cubic-bezier(0.65,0,0.35,1) 160ms` : `transform 320ms ${EASE}`,\n                        }}\n                      />\n                    </span>\n                    <span className=\"flex-1\" />\n                    {(t.due || t.assignee) && <Meta task={t} faded={t.done} reduced={reduced} />}\n                  </button>\n                </li>\n              ))}\n              {total === 0 && !adding && (\n                <li className=\"flex items-center text-[13px] text-muted-foreground\" style={{ height: ROW }}>\n                  Nothing here yet.\n                </li>\n              )}\n            </ul>\n\n            {onAdd && (\n              <div ref={addRowRef} className=\"flex items-center gap-3\" style={{ height: ROW }}>\n                <span\n                  aria-hidden=\"true\"\n                  className=\"flex size-[18px] shrink-0 items-center justify-center rounded-[6px] text-muted-foreground\"\n                  style={{ boxShadow: `inset 0 0 0 1.5px ${mix(\"var(--foreground)\", 14, \"var(--border)\")}` }}\n                >\n                  {busy ? (\n                    <svg viewBox=\"0 0 12 12\" className=\"size-3 animate-spin\" fill=\"none\">\n                      <path d=\"M6 1.5a4.5 4.5 0 1 1-4.5 4.5\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n                    </svg>\n                  ) : (\n                    <Plus className=\"size-3\" strokeWidth={2.2} />\n                  )}\n                </span>\n                {adding ? (\n                  <input\n                    ref={inputRef}\n                    value={draft}\n                    readOnly={busy}\n                    aria-label={`New task in ${current?.title ?? \"list\"}`}\n                    placeholder=\"Add a task\"\n                    onChange={(e) => setDraft(e.target.value)}\n                    onKeyDown={(e) => {\n                      if (e.key === \"Enter\") {\n                        e.preventDefault();\n                        submit();\n                      } else if (e.key === \"Escape\") {\n                        setDraft(\"\");\n                        setAdding(false);\n                      }\n                    }}\n                    onBlur={() => {\n                      if (!draft.trim() && !busy) setAdding(false);\n                    }}\n                    className=\"h-full min-w-0 flex-1 bg-transparent text-[16px] text-foreground outline-none placeholder:text-muted-foreground sm:text-[13.5px]\"\n                  />\n                ) : (\n                  <button\n                    type=\"button\"\n                    onClick={() => {\n                      setAdding(true);\n                      requestAnimationFrame(() => inputRef.current?.focus());\n                    }}\n                    className={`h-full min-w-0 flex-1 cursor-pointer rounded-[6px] text-left text-[16px] text-muted-foreground transition-colors duration-200 hover:text-foreground sm:text-[13.5px] ${FOCUS}`}\n                  >\n                    Add a task\n                  </button>\n                )}\n              </div>\n            )}\n          </div>\n        </div>\n      </div>\n\n      <div className=\"relative flex h-11 items-center justify-between gap-2 pl-4 pr-1.5\" style={{ color: ink }}>\n        {current?.href ? (\n          <a\n            href={current.href}\n            className={`-mx-1 inline-flex min-w-0 items-center gap-1 rounded-[6px] px-1 text-[12.5px] font-medium transition-opacity duration-200 hover:opacity-75 ${FOCUS}`}\n          >\n            <span className=\"truncate\">\n              <TextMorph>{current.linkLabel ?? \"View all\"}</TextMorph>\n            </span>\n            <ArrowUpRight aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n          </a>\n        ) : (\n          <span className=\"text-[12.5px] font-medium tabular-nums\">\n            <TextMorph>{total - done === 0 ? \"Nothing left\" : `${total - done} left`}</TextMorph>\n          </span>\n        )}\n        {lists.length > 1 && (\n          <div className=\"flex shrink-0 items-center\">\n            {[-1, 1].map((dir) => {\n              const target = lists[(index + dir + lists.length) % lists.length];\n              const Icon = dir < 0 ? ChevronLeft : ChevronRight;\n              return (\n                <button\n                  key={dir}\n                  type=\"button\"\n                  aria-label={`${dir < 0 ? \"Previous\" : \"Next\"} list: ${target.title}`}\n                  onClick={() => go(dir)}\n                  className={`flex size-8 cursor-pointer items-center justify-center rounded-full transition-[background-color,scale] duration-200 hover:bg-[color-mix(in_oklab,currentColor_12%,transparent)] active:scale-[0.92] ${FOCUS}`}\n                  style={{ transitionTimingFunction: EASE }}\n                >\n                  <Icon aria-hidden=\"true\" className=\"size-4\" strokeWidth={2.2} />\n                </button>\n              );\n            })}\n          </div>\n        )}\n      </div>\n      <p className=\"sr-only\" aria-live=\"polite\">\n        {said}\n      </p>\n    </div>\n  );\n}\n\nfunction Meta({ task, faded, reduced }: { task: TaskItem; faded: boolean; reduced: boolean }) {\n  return (\n    <span\n      className=\"flex shrink-0 items-center gap-2\"\n      style={{ opacity: faded ? 0.4 : 1, transition: reduced ? \"none\" : `opacity ${STRIKE}ms ease ${faded ? 300 : 0}ms` }}\n    >\n      {task.due && (\n        <span className={`text-[11.5px] tabular-nums ${task.late && !faded ? \"font-medium text-red-600 dark:text-red-400\" : \"text-muted-foreground\"}`}>{task.due}</span>\n      )}\n      {task.assignee &&\n        (task.assignee.src ? (\n          // eslint-disable-next-line @next/next/no-img-element\n          <img src={task.assignee.src} alt={task.assignee.name} className=\"size-5 rounded-full object-cover\" />\n        ) : (\n          <span\n            role=\"img\"\n            aria-label={task.assignee.name}\n            className=\"flex size-5 items-center justify-center rounded-full text-[9px] font-semibold\"\n            style={{ background: mix(hue(task.assignee.name), 20, \"var(--card)\"), color: mix(hue(task.assignee.name), 80, \"var(--foreground)\") }}\n          >\n            {initials(task.assignee.name)}\n          </span>\n        ))}\n    </span>\n  );\n}\n"}],"css":{},"docs":"Docs and live preview: https://hairlineui.com/ui/task-card. MIT licensed: https://hairlineui.com/license#components","meta":{"license":"MIT"}}